clip-forge/docker-compose.yml

92 lines
2.3 KiB
YAML

services:
postgres:
image: postgres:15-alpine
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-clipforge}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme_clipforge_2025}
POSTGRES_DB: ${POSTGRES_DB:-clipforge}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./database/init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-clipforge}"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
restart: unless-stopped
command: redis-server --maxmemory 256mb --maxmemory-policy allkeys-lru
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
backend:
build:
context: ./backend
dockerfile: Dockerfile
restart: unless-stopped
env_file: .env
environment:
- DATABASE_URL=${DATABASE_URL:-postgresql+asyncpg://clipforge:changeme_clipforge_2025@postgres:5432/clipforge}
- REDIS_URL=${REDIS_URL:-redis://redis:6379/0}
volumes:
- media_data:/data
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
labels:
- "traefik.enable=true"
- "traefik.http.routers.clipforge.rule=Host(`clip.jeffemmett.com`)"
- "traefik.http.services.clipforge.loadbalancer.server.port=8000"
networks:
- default
- traefik-public
worker:
build:
context: ./backend
dockerfile: Dockerfile
restart: unless-stopped
command: ["arq", "app.worker.WorkerSettings"]
env_file: .env
environment:
- DATABASE_URL=${DATABASE_URL:-postgresql+asyncpg://clipforge:changeme_clipforge_2025@postgres:5432/clipforge}
- REDIS_URL=${REDIS_URL:-redis://redis:6379/0}
volumes:
- media_data:/data
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
extra_hosts:
- "host.docker.internal:host-gateway"
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
restart: unless-stopped
labels:
- "traefik.enable=false"
networks:
- default
volumes:
postgres_data:
redis_data:
media_data:
networks:
traefik-public:
external: true