Assist_Design/compose-plesk.yaml

96 lines
2.4 KiB
YAML

# 🚀 Customer Portal - Plesk Docker Stack
services:
frontend:
image: portal-frontend:latest
container_name: portal-frontend
ports:
- "127.0.0.1:3000:3000"
env_file:
- /var/www/vhosts/asolutions.jp/private/env/portal-frontend.env
environment:
- PORT=3000
- HOSTNAME=0.0.0.0
restart: unless-stopped
depends_on:
- backend
# use built-in bridge; don't let compose create a network
network_mode: bridge
# allow service-name DNS via legacy links
links:
- backend
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health"]
interval: 30s
timeout: 10s
start_period: 40s
retries: 3
backend:
image: portal-backend:latest
container_name: portal-backend
ports:
- "127.0.0.1:4000:4000"
env_file:
- /var/www/vhosts/asolutions.jp/private/env/portal-backend.env
environment:
- PORT=4000
volumes:
- /var/www/vhosts/asolutions.jp/private/secrets:/app/secrets:ro
restart: unless-stopped
depends_on:
- database
- cache
network_mode: bridge
links:
- database
- cache
command: >
sh -c "
until nc -z database 5432; do echo 'waiting for db'; sleep 2; done;
pnpm prisma migrate deploy && node dist/main
"
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:4000/health"]
interval: 30s
timeout: 10s
start_period: 60s
retries: 3
database:
image: postgres:17-alpine
container_name: portal-database
env_file:
- /var/www/vhosts/asolutions.jp/private/env/portal-backend.env
environment:
- POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C
volumes:
- postgres_data:/var/lib/postgresql/data
restart: unless-stopped
network_mode: bridge
healthcheck:
test: ["CMD-SHELL", "pg_isready -U portal -d portal_prod"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
cache:
image: redis:7-alpine
container_name: portal-cache
volumes:
- redis_data:/data
restart: unless-stopped
network_mode: bridge
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
volumes:
postgres_data:
driver: local
redis_data:
driver: local