Files
Tanken/docker-compose.yml

51 lines
1.4 KiB
YAML

services:
postgres:
image: postgres:17-alpine
container_name: tanken-postgres
restart: unless-stopped
environment:
POSTGRES_DB: tanken
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d tanken"]
interval: 10s
timeout: 5s
retries: 5
tanken:
build: .
container_name: tanken-webapp
depends_on:
postgres:
condition: service_healthy
ports:
- "3847:3847"
restart: unless-stopped
volumes:
- tanken_config:/app/config
environment:
- NODE_ENV=production
- PORT=3847
- DATABASE_URL=postgresql://postgres:postgres@postgres:5432/tanken
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3847/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
# Explicit volume names: without them Docker prefixes the compose project
# name (usually the directory or stack name), so redeploying from a renamed
# directory / new stack silently creates FRESH EMPTY volumes and the app
# loses its database and config. Pinned names survive any project rename.
volumes:
postgres_data:
name: tanken_postgres_data
tanken_config:
name: tanken_config