Skip to main content

docker-compose.yml

This is the shared docker-compose.yml content used in the Linux and Windows QuickStart documents. You may change the restart option to match your environment.

services:
postgres:
image: postgres:16
container_name: namoo-postgres
restart: unless-stopped
environment:
TZ: ${TZ:-Asia/Seoul}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
volumes:
- ${DATA_PATH}/postgres:/var/lib/postgresql/data
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U \"$$POSTGRES_USER\" -d \"$$POSTGRES_DB\" && psql -U \"$$POSTGRES_USER\" -d \"$$POSTGRES_DB\" -tAc 'SELECT 1' | grep -q 1",
]
interval: 5s
timeout: 5s
retries: 30
start_period: 60s

app:
image: ${DOCKER_IMAGE}
pull_policy: always
container_name: namoo-bookself
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
restart: true
ports:
- "${SERVER_HTTP_PORT:-8080}:${SERVER_HTTP_PORT:-8080}"
environment:
TZ: ${TZ:-Asia/Seoul}
DOTNET_ENVIRONMENT: Docker
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
APP_USER_ID: ${APP_USER_ID}
DB_HOST: ${DB_HOST}
DB_PORT: ${DB_PORT}
DB_NAME: ${DB_NAME}
Server__SERVER_URL: "+"
Server__SERVER_HTTP_PORT: ${SERVER_HTTP_PORT}
LOG_FILE_ENABLED: ${LOG_FILE_ENABLED:-N}
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- ${DATA_PATH}/Files:/app/Files
- ${DATA_PATH}/Log:/app/Log
- ${DATA_PATH}/License:/app/License
- ${DATA_PATH}/UserConfig:/app/Config/User