Skip to content

Starting with Docker Image Using SQL Server as Database

Overview

This is the procedure for starting Pleasanter from the official Docker image with SQL Server specified as the database.

Cautions

  1. The procedure on this page uses a multi-container configuration that includes the SQL Server container in the same Docker configuration as Pleasanter, for users who want to try Pleasanter right away. This configuration is not intended for production use.
  2. In production use, the database container becomes a performance bottleneck. We strongly recommend placing the database on a separate host.
  3. The time zone is set to Japan and the language is set to Japanese. Change them as necessary.
  4. The edition of the official SQL Server Docker image (mcr.microsoft.com/mssql/server:2025-latest) is Enterprise Developer Edition by default, but this procedure uses Express Edition. When you need to change the edition, rewrite the value of MSSQL_PID in .env by referring to Microsoft's documentation.

    .env
    MSSQL_PID=Express
    
  5. Connecting to SQL Server requires TLS encryption with a trusted certificate. Note that this procedure skips the verification of the certificate. Set an appropriate certificate in a production environment. For details, refer to "Notes on Connection Strings When Using SQL Server as the Database in Pleasanter".

Prerequisites

  1. This procedure uses SQL Server as the database. For the procedures that use other databases, refer to the following.

  2. This procedure assumes that you can use the official Docker image of Pleasanter and start it with modified parameter files, following the two manuals below. Database creation is not required.

    1. Launch with Docker
    2. Use a Docker Image and Start It by Changing the Parameters from the Default

    If you have not read them yet, refer to the above manuals and confirm that you can use the official Docker image of Pleasanter and start it with modified parameter files.

Operation Procedure

1. Arrange Folders and Files

Configure the folders in the project directory (pleasanter in the example below) as follows and arrange the files.

📁 pleasanter
    +--📁 app_data_parameters
    |   +--📄 Rds.json
    |   +--📄 Service.json
    |
    +--📁 CodeDefiner
    |   +--📄 Dockerfile
    |
    +--📁 Pleasanter
    |   +--📄 Dockerfile
    |
    +--📁 SQLServer
    |   +--📄 Dockerfile
    |
    |--📄 .env
    +--📄 compose.yml

1-1 Parameter Files

  1. Download Pleasanter from the Download Center. Download the latest version unless you have a particular reason not to. When you need a specific version released in the past, download that version of Pleasanter.
  2. Extract the zip file.
  3. Copy "Rds.json" and "Service.json" in "\pleasanter\Implem.Pleasanter\App_Data\Parameters" under the extracted folder to the app_data_parameters folder.
  4. Edit "Rds.json" and "Service.json" as follows.
1-1-1 app_data_parameters/Rds.json
  1. Set the value of "Dbms" to "SQLServer".
  2. Set the values of "SaConnectionString", "OwnerConnectionString", and "UserConnectionString" to null.

    app_data_parameters/Rds.json
    1
    2
    3
    4
    5
    6
    7
    8
    9
    {
        "Dbms": "SQLServer",
        "Provider": "Local",
        "SaConnectionString": null,
        "OwnerConnectionString": null,
        "UserConnectionString": null,
        "SqlCommandTimeOut": 0,
            : omitted
    }
    
1-1-2 app_data_parameters/Service.json
  1. Set the value of "TimeZoneDefault" to "Asia/Tokyo". This is because the base image of SQL Server is Linux and the Linux time zone needs to be set.
  2. Set the value of "DefaultLanguage" to "ja" (Japanese).

    app_data_parameters/Service.json
    {
        "Name": "Implem.Pleasanter",
        "EnvironmentName": null,
        "TimeZoneDefault": "Asia/Tokyo",
        "DefaultPassword": "pleasanter",
        "DeploymentEnvironment": null,
        "WithoutChangeDefaultPassword": false,
        "DefaultLanguage": "ja",
        "AbsoluteUri": null,
            : omitted
    }
    

1-2 CodeDefiner/Dockerfile

Create CodeDefiner/Dockerfile with the following content.

CodeDefiner/Dockerfile
1
2
3
4
FROM implem/pleasanter:codedefiner

COPY app_data_parameters/ /app/Implem.Pleasanter/App_Data/Parameters/
ENTRYPOINT [ "dotnet", "Implem.CodeDefiner.dll" ]

1-3 Pleasanter/Dockerfile

Create Pleasanter/Dockerfile with the following content.

Pleasanter/Dockerfile
1
2
3
4
5
ARG VERSION=latest
FROM implem/pleasanter:${VERSION}

COPY app_data_parameters/ App_Data/Parameters/
ENTRYPOINT [ "dotnet", "Implem.Pleasanter.dll" ]

1-4 SQLServer/Dockerfile

To enable full-text search, use the SQL Server image as the base and install full-text search.

SQLServer/Dockerfile
FROM mcr.microsoft.com/mssql/server:2025-latest

USER root

RUN apt-get update && apt-get install -y curl apt-transport-https gnupg2 && \
    curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
    curl https://packages.microsoft.com/config/ubuntu/24.04/mssql-server-2025.list -o /etc/apt/sources.list.d/mssql-server-2025.list && \
    apt-get update && \
    apt-get install -y mssql-server-fts && \
    apt-get clean && rm -rf /var/lib/apt/lists

EXPOSE 1433
USER mssql
ENTRYPOINT [ "/opt/mssql/bin/sqlservr" ]

1-5 .env

Modify {{ ... }} to suit your environment. For TrustServerCertificate=true; in the connection strings, refer to this page.

.env
1
2
3
4
5
6
7
8
PLEASANTER_VER=latest
SA_PASSWORD={{Sa Password}}
MSSQL_PID=Express

Implem_Pleasanter_Rds_SQLServer_SaConnectionString=Server=db;Database=master;UID=sa;PWD={{Sa Password}};TrustServerCertificate=true
Implem_Pleasanter_Rds_SQLServer_OwnerConnectionString=Server=db;Database=#ServiceName#;UID=#ServiceName#_Owner;PWD={{Owner password}};TrustServerCertificate=true
Implem_Pleasanter_Rds_SQLServer_UserConnectionString=Server=db;Database=#ServiceName#;UID=#ServiceName#_User;PWD={{User password}};TrustServerCertificate=true
TZ=Asia/Tokyo

1-6 compose.yaml

Create compose.yaml with the following content.

compose.yaml
services:
  pleasanter:
    build:
      context: .
      dockerfile: ./Pleasanter/Dockerfile
      args:
        - VERSION=${PLEASANTER_VER}
    container_name: pleasanter_${PLEASANTER_VER}
    restart: unless-stopped
    depends_on:
      db:
        condition: service_healthy
    environment:
      Implem.Pleasanter_Rds_SaConnectionString: ${Implem_Pleasanter_Rds_SQLServer_SaConnectionString}
      Implem.Pleasanter_Rds_OwnerConnectionString: ${Implem_Pleasanter_Rds_SQLServer_OwnerConnectionString}
      Implem.Pleasanter_Rds_UserConnectionString: ${Implem_Pleasanter_Rds_SQLServer_UserConnectionString}
      TZ: ${TZ}
    ports:
      - '8881:8080'
    networks:
      - default
  codedefiner:
    build:
      context: .
      dockerfile: ./CodeDefiner/Dockerfile
    container_name: codedefiner
    depends_on:
      db:
        condition: service_healthy
    environment:
      Implem.Pleasanter_Rds_SaConnectionString: ${Implem_Pleasanter_Rds_SQLServer_SaConnectionString}
      Implem.Pleasanter_Rds_OwnerConnectionString: ${Implem_Pleasanter_Rds_SQLServer_OwnerConnectionString}
      Implem.Pleasanter_Rds_UserConnectionString: ${Implem_Pleasanter_Rds_SQLServer_UserConnectionString}
      TZ: ${TZ}
    networks:
      - default
    stdin_open: true
  db:
    build:
      context: .
      dockerfile: ./SQLServer/Dockerfile
    container_name: sqldb
    restart: unless-stopped
    environment:
      ACCEPT_EULA: 'Y'
      MSSQL_SA_PASSWORD: ${SA_PASSWORD}
      MSSQL_PID: ${MSSQL_PID}
      TZ: ${TZ}
    ports:
      - '11433:1433'
    networks:
      - default
    volumes:
      - sqlvolume:/var/opt/mssql
    healthcheck:
      test: /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P $$MSSQL_SA_PASSWORD -Q "SELECT 1" -No || exit 1
      interval: 10s
      timeout: 5s
      retries: 10
      start_period: 30s

volumes:
  sqlvolume:

networks:
  default:
    name: pleasanter_prod_network

2. Build Container Images

Execute the following command. It builds each service (pleasanter, codedefiner, and db). By specifying the --pull option, image updates are checked and the latest images are retrieved.

docker compose build --pull pleasanter codedefiner db

3. Start Containers

Execute the following command. The db container (SQL Server) starts.

docker compose up -d db

Execute the following command. The codedefiner container starts and the database is initialized. Since the time zone and the language are set in Service.json in advance in this procedure, the /l and /z options are not required. To skip the confirmation step before initialization, add the /y option.

docker compose run --rm codedefiner _rds

4. Start Pleasanter

4-1 Start the Pleasanter Container

Execute the following command. The Pleasanter container starts.

docker compose up -d pleasanter

4-2 Verification

  1. Access the following URL from a browser.

    http://localhost:8881
    
  2. Enter the following on the login screen.

    Login ID Password
    Administrator pleasanter
  3. After logging in, you are prompted to change the password, so set a password as appropriate.

4-3 Connect to the SQL Server Container

You can connect from SSMS or other compatible tools via port 11433 on the host. According to compose.yml, it is mapped to SQL Server (port 1433) inside the container.

5. Stopping and Removing Containers

5-1 Stop Containers

To stop the containers, execute the following command.

docker compose stop

Stopping the containers does not delete the database data (volumes).

5-2 Restart Stopped Containers

To restart the stopped containers, execute the following command.

docker compose start

Stopping the containers does not delete the database data (volumes). When restarting, the data can be used as is.

5-3 Remove Containers

To remove the containers, execute the following command. Removing the containers does not delete the database data (volumes).

docker compose down

Note that once the containers are removed, they cannot be restarted with docker compose start.

5-4 Recreate Containers

To create and start the containers, execute the following command. The db container is created and the database data (volume) can be used.

docker compose up -d pleasanter

5-5 Remove the Database Data When Removing Containers

To delete the database data (volumes) at the same time as removing the containers, execute the command with the option to remove volumes (-v).

docker compose down -v

6. Running CodeDefiner After Changing Parameters

If you run CodeDefiner after setting parameters, such as when using the System Log Extended Function, follow the steps below.

  1. Perform step 1 of the operation procedure, store the changed parameter files in app_data_parameters, and create .env and compose.yaml.
  2. If Pleasanter is running, execute the following command to stop and remove the containers.

    docker compose down
    
  3. Execute the following command to build the pleasanter and codedefiner containers.

    docker compose build pleasanter codedefiner
    
  4. Run CodeDefiner.

    docker compose run --rm codedefiner _rds
    
  5. Start the pleasanter container.

    docker compose up -d pleasanter
    

Launch with Docker
Use a Docker Image and Start It by Changing the Parameters from the Default
Upgrade the Docker Image of Pleasanter