Assist_Design/compose-plesk.yaml
T. Narantuya 0bf872e249 Refactor code formatting and improve documentation clarity
- Adjusted YAML and JSON files for consistent formatting, including healthcheck commands and package exports.
- Enhanced readability in various TypeScript files by standardizing string quotes and improving line breaks.
- Updated documentation across multiple files to improve clarity and consistency, including address system and logging levels.
- Removed unnecessary package-lock.json from shared package directory to streamline dependencies.
2025-09-09 18:19:54 +09:00

98 lines
2.5 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;
until nc -z cache 6379; do echo 'waiting for redis'; sleep 2; done;
pnpm dlx prisma migrate deploy && node dist/main.js
"
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