Skip to content

Use a Docker Image and Start It by Changing the Parameters from the Default Values

Overview

This is the procedure for specifying PostgreSQL as the database, changing the parameters from their default values, and starting Pleasanter from the official Docker image.

Limitations

  1. When you perform this procedure with ver1.4.5 or earlier, the CodeDefiner command is different. Refer to the following page.
    About the CodeDefiner procedure when installing for the first time from version 1.4.6
  2. The procedure on this page uses a multi-container configuration that includes the PostgreSQL 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.
  3. In production use, the database container becomes a performance bottleneck. We strongly recommend using a database on a separate host.

Prerequisites

  1. This procedure uses PostgreSQL as the database. For the procedure using another database, refer to the following.
  2. This procedure assumes that Docker is available as described in the manual below.
    Refer to the manual below and check that you can start Pleasanter using the official Docker image of Pleasanter.
  3. When you use PostgreSQL as the database, you do not need to place or edit Rds.json.

Operation Procedure

1. Placing Files and Creating Folders

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

📁pleasanter
    +-- 📁app_data_parameters
    |   +-- 📁folder for extended features
    |   |   +-- 📄file for extended features
    |   |  
    |   +-- 📄parameter file
    |
    |-- 📄.env
    |-- 📄compose.yaml
Folder
or file
Description
app_data_parameters A folder for storing the parameter files configured for your environment. Store the folders and files for extended features, such as extended SQL and extended scripts, in this folder as well if necessary.
.env A file that describes settings such as the database connection information, and environment variables
compose.yaml The configuration file of Docker Compose

1-1. Creating the app_data_parameters Folder

  1. Run the following command in the project directory to create the app_data_parameters folder.

    mkdir ./app_data_parameters
    

1-2. Preparing the Parameter Files

  1. Download Pleasanter from the Download Center. Unless you have a particular reason, download the latest version. If you need a specific version released in the past, download that version of Pleasanter.
  2. Extract the zip file to any location.
  3. From "\pleasanter\Implem.Pleasanter\App_Data\Parameters" in the extracted folder, copy the parameters you want to change under the app_data_parameters folder created in 1-1.
  4. Change the contents of the parameters as necessary and update them.
  5. When you configure extended features such as extended SQL (ExtendedSqls) or extended scripts (ExtendedScripts), copy the folders for the extended features to app_data_parameters, and create the files for the extended features in each copied folder.

1-3 The .env File

  1. Run the following command to create the .env file.

    type nul > .env
    
    New-Item .env -ItemType File -Force
    
    touch .env
    
  2. Open .env in a text editor, paste the following content, and save it. Modify {{ ... }} as necessary for your environment. For each setting, refer to the description of the .env file in "Launch with Docker".

    .env
    POSTGRES_VERSION={{PostgreSQL Version}}
    POSTGRES_VOLUMES_TARGET={{Volumes TargetPath}}
    POSTGRES_USER=postgres
    POSTGRES_PASSWORD={{Sa Password}}
    POSTGRES_DB=postgres
    POSTGRES_HOST_AUTH_METHOD=scram-sha-256
    POSTGRES_INITDB_ARGS="--auth-host=scram-sha-256"
    PLEASANTER_VERSION={{Pleasanter Version}}
    Implem_Pleasanter_Rds_PostgreSQL_SaConnectionString="Server=db;Database=postgres;UID=postgres;PWD={{Sa Password}}"
    Implem_Pleasanter_Rds_PostgreSQL_OwnerConnectionString="Server=db;Database=#ServiceName#;UID=#ServiceName#_Owner;PWD={{Owner password}}"
    Implem_Pleasanter_Rds_PostgreSQL_UserConnectionString="Server=db;Database=#ServiceName#;UID=#ServiceName#_User;PWD={{User password}}"
    

1-4 The compose.yaml File

  1. Run the following command to create the compose.yaml file.

    type nul > compose.yaml
    
    New-Item compose.yaml -ItemType File -Force
    
    touch compose.yaml
    
  2. Open compose.yaml in a text editor, paste the following content, and save it.

    compose.yaml
    services:
      db:
        container_name: postgres
        image: postgres:${POSTGRES_VERSION}
        environment:
          - POSTGRES_USER
          - POSTGRES_PASSWORD
          - POSTGRES_DB
          - POSTGRES_HOST_AUTH_METHOD
          - POSTGRES_INITDB_ARGS
        volumes:
          - type: volume
            source: pg_data
            target: ${POSTGRES_VOLUMES_TARGET}
        networks:
          - backend
        healthcheck:
          test:
            [
              "CMD-SHELL",
              "pg_isready -U $${POSTGRES_USER:-postgres} -d $${POSTGRES_DB:-postgres} || exit 1",
            ]
          interval: 10s
          timeout: 5s
          retries: 5
          start_period: 30s
        restart: unless-stopped
      param-init:
        container_name: param-init
        image: implem/pleasanter:${PLEASANTER_VERSION}
        volumes:
          - ./app_data_parameters:/tmp/app_data_parameters:ro
          - pleasanter_params:/app/App_Data/Parameters
        entrypoint:
          - sh
          - -c
          - cp -rf /tmp/app_data_parameters/. /app/App_Data/Parameters/ && echo "Parameters copied"
        restart: "no"
        network_mode: none
      param-init-codedefiner:
        container_name: param-init-codedefiner
        image: implem/pleasanter:codedefiner
        volumes:
          - ./app_data_parameters:/tmp/app_data_parameters:ro
          - codedefiner_params:/app/Implem.Pleasanter/App_Data/Parameters
        entrypoint:
          - sh
          - -c
          - cp -rf /tmp/app_data_parameters/. /app/Implem.Pleasanter/App_Data/Parameters/ && echo "Parameters copied"
        restart: "no"
        network_mode: none
      pleasanter:
        container_name: pleasanter
        image: implem/pleasanter:${PLEASANTER_VERSION}
        restart: unless-stopped
        depends_on:
          db:
            condition: service_healthy
          param-init:
            condition: service_completed_successfully
        ports:
          - '50001:8080'
        environment:
          Implem.Pleasanter_Rds_PostgreSQL_SaConnectionString: ${Implem_Pleasanter_Rds_PostgreSQL_SaConnectionString}
          Implem.Pleasanter_Rds_PostgreSQL_OwnerConnectionString: ${Implem_Pleasanter_Rds_PostgreSQL_OwnerConnectionString}
          Implem.Pleasanter_Rds_PostgreSQL_UserConnectionString: ${Implem_Pleasanter_Rds_PostgreSQL_UserConnectionString}
        volumes:
          - pleasanter_params:/app/App_Data/Parameters
        networks:
          - backend
      codedefiner:
        container_name: codedefiner
        image: implem/pleasanter:codedefiner
        depends_on:
          db:
            condition: service_healthy
          param-init-codedefiner:
            condition: service_completed_successfully
        environment:
          Implem.Pleasanter_Rds_PostgreSQL_SaConnectionString: ${Implem_Pleasanter_Rds_PostgreSQL_SaConnectionString}
          Implem.Pleasanter_Rds_PostgreSQL_OwnerConnectionString: ${Implem_Pleasanter_Rds_PostgreSQL_OwnerConnectionString}
          Implem.Pleasanter_Rds_PostgreSQL_UserConnectionString: ${Implem_Pleasanter_Rds_PostgreSQL_UserConnectionString}
        volumes:
          - codedefiner_params:/app/Implem.Pleasanter/App_Data/Parameters
        networks:
          - backend
    networks:
      backend:
    volumes:
      pg_data:
        name: ${COMPOSE_PROJECT_NAME:-default}_pg_data_volume
      pleasanter_params:
        name: ${COMPOSE_PROJECT_NAME:-default}_pleasanter_params_volume
      codedefiner_params:
        name: ${COMPOSE_PROJECT_NAME:-default}_codedefiner_params_volume
    

2. Restarting Pleasanter

  1. If Pleasanter is running, run the following command to stop Pleasanter.

    docker compose down
    
  2. Run the following command to clear the volume for the parameters. Modify {{Project directory name}} as necessary for your environment. If the volume for the parameters does not exist, for example when you run this procedure for the first time, an error stating that the volume does not exist is returned, but continue from step 3.

    docker volume rm {{Project directory name}}_pleasanter_params_volume
    

    Example: when the project directory is "pleasanter", the command is as follows.

    docker volume rm pleasanter_pleasanter_params_volume
    
  3. Run the following command to start Pleasanter.

    docker compose up -d pleasanter
    

3. Logging In to Pleasanter

  1. Access Pleasanter in a browser, and log in by entering your login ID and password on the login screen.

    http://localhost:50001
    
  2. Check that the parameters you set have been applied.

4. When Running CodeDefiner After Changing the Parameters

When you run CodeDefiner after setting the parameters, for example when you use the "System Log Extended Function", run it with the following procedure.

  1. Perform "1. Placing Files and Creating Folders" and store the changed parameter files in app_data_parameters.
  2. If Pleasanter is running, run the following command to stop Pleasanter.

    docker compose down
    
  3. Run the following command to clear the volume for the parameters. Modify {{Project directory name}} as necessary for your environment.

    docker volume rm {{Project directory name}}_codedefiner_params_volume
    

    Example: when the project directory is "pleasanter", the command is as follows.

    docker volume rm pleasanter_codedefiner_params_volume
    
  4. Run CodeDefiner.

    docker compose run --rm codedefiner _rds