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