76 lines
2.0 KiB
YAML
76 lines
2.0 KiB
YAML
services:
|
|
db:
|
|
image: postgres:17
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: opencut
|
|
POSTGRES_PASSWORD: opencutthegoat
|
|
POSTGRES_DB: opencut
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
ports:
|
|
- "5432:5432"
|
|
healthcheck:
|
|
test: ["CMD", "pg_isready -U opencut"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 5
|
|
start_period: 10s
|
|
|
|
redis:
|
|
image: redis
|
|
ports:
|
|
- "6379:6379"
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 5
|
|
start_period: 10s
|
|
|
|
serverless-redis-http:
|
|
image: hiett/serverless-redis-http:latest
|
|
ports:
|
|
- "8079:80"
|
|
environment:
|
|
SRH_MODE: env
|
|
SRH_TOKEN: example_token
|
|
SRH_CONNECTION_STRING: "redis://redis:6379"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget --spider -q http://127.0.0.1:80 || exit 1"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 5
|
|
start_period: 10s
|
|
depends_on:
|
|
- redis
|
|
|
|
web:
|
|
build:
|
|
context: ./apps/web
|
|
dockerfile: Dockerfile
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
# Example environment variables - these should be tailored
|
|
# using apps/web/.env.example as a guide
|
|
NEXT_PUBLIC_DATABASE_URL: "postgresql://opencut:opencutthegoat@db:5432/opencut"
|
|
NEXT_PUBLIC_REDIS_URL: "redis://redis:6379"
|
|
NEXT_PUBLIC_UPSTASH_REDIS_REST_URL: "http://serverless-redis-http:8079"
|
|
NEXT_PUBLIC_UPSTASH_REDIS_REST_TOKEN: "example_token"
|
|
# Add other necessary environment variables from .env.example
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
serverless-redis-http:
|
|
condition: service_healthy
|
|
volumes:
|
|
- ./apps/web:/app # Optional: for development to reflect code changes without rebuilding
|
|
- /app/node_modules # Ensure node_modules in container is used
|
|
- /app/.next # Ensure .next in container is used
|
|
|
|
volumes:
|
|
postgres_data:
|