name: bap-selfhost
services:
app:
build: .
container_name: bap-app
env_file: .env
environment:
NODE_ENV: production
PORT: "3000"
HOSTNAME: "0.0.0.0"
ports:
- "3000:3000"
depends_on:
database:
condition: service_healthy
redis:
condition: service_healthy
minio:
condition: service_healthy
restart: unless-stopped
worker:
build: .
container_name: bap-worker
env_file: .env
command: ["bun", "worker"]
depends_on:
database:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
ws:
build: .
container_name: bap-ws
env_file: .env
command: ["bun", "scripts/start-ws.ts"]
environment:
WS_PORT: "4097"
ports:
- "4097:4097"
depends_on:
database:
condition: service_healthy
restart: unless-stopped
database:
image: postgres
container_name: bap-postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: bap
ports:
- "5432:5432"
volumes:
- bap_postgres_data:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:8-alpine
container_name: bap-redis
ports:
- "6379:6379"
volumes:
- bap_redis_data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
minio:
image: minio/minio
container_name: bap-minio
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: ${S3_ACCESS_KEY_ID}
MINIO_ROOT_PASSWORD: ${S3_SECRET_ACCESS_KEY}
ports:
- "9000:9000"
- "9001:9001"
volumes:
- bap_minio_data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 10s
timeout: 5s
retries: 5
volumes:
bap_postgres_data:
bap_redis_data:
bap_minio_data: