70 lines
1.4 KiB
YAML
70 lines
1.4 KiB
YAML
version: "3.9"
|
|
|
|
services:
|
|
db:
|
|
image: postgres:16-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: storybid
|
|
POSTGRES_PASSWORD: storybid
|
|
POSTGRES_DB: storybid
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
ports:
|
|
- "5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U storybid"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
restart: unless-stopped
|
|
volumes:
|
|
- redis_data:/data
|
|
ports:
|
|
- "6379:6379"
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
server:
|
|
build:
|
|
context: .
|
|
dockerfile: packages/server/Dockerfile
|
|
restart: unless-stopped
|
|
env_file: .env
|
|
environment:
|
|
DATABASE_URL: postgresql://storybid:storybid@db:5432/storybid
|
|
REDIS_URL: redis://redis:6379
|
|
NODE_ENV: production
|
|
UPLOAD_DIR: /app/uploads
|
|
MEDIA_BASE_URL: /media
|
|
volumes:
|
|
- media_data:/app/uploads
|
|
ports:
|
|
- "3001:3001"
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
|
|
client:
|
|
build:
|
|
context: .
|
|
dockerfile: packages/client/Dockerfile
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8080:80"
|
|
depends_on:
|
|
- server
|
|
|
|
volumes:
|
|
postgres_data:
|
|
redis_data:
|
|
media_data:
|