Files
unfiAgent/docker-compose.yml
Rasmus 80dcd8a96a
Some checks failed
CI / build-test (push) Has been cancelled
Fixed errors
2026-02-19 14:06:29 +01:00

90 lines
2.2 KiB
YAML

services:
postgres:
image: postgres:16
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-unfi_agent}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-unfi_agent}
POSTGRES_DB: ${POSTGRES_DB:-unfi_agent}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-unfi_agent} -d ${POSTGRES_DB:-unfi_agent}"]
interval: 5s
timeout: 5s
retries: 20
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
redis:
image: redis:7
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 20
ports:
- "6379:6379"
volumes:
- redis_data:/data
api:
build:
context: .
dockerfile: apps/api/Dockerfile
restart: unless-stopped
env_file:
- .env
environment:
DATABASE_URL: postgres://${POSTGRES_USER:-unfi_agent}:${POSTGRES_PASSWORD:-unfi_agent}@postgres:5432/${POSTGRES_DB:-unfi_agent}
REDIS_URL: redis://redis:6379
API_PORT: 8080
API_INTERNAL_URL: http://api:8080
WORKER_SHARED_SECRET: ${WORKER_SHARED_SECRET:-local-worker-secret}
extra_hosts:
- "host.docker.internal:host-gateway"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
ports:
- "8080:8080"
volumes:
- ./secrets/unfi_encryption_key:/run/secrets/unfi_encryption_key:ro
worker:
build:
context: .
dockerfile: apps/worker/Dockerfile
restart: unless-stopped
env_file:
- .env
environment:
DATABASE_URL: postgres://${POSTGRES_USER:-unfi_agent}:${POSTGRES_PASSWORD:-unfi_agent}@postgres:5432/${POSTGRES_DB:-unfi_agent}
REDIS_URL: redis://redis:6379
API_INTERNAL_URL: http://api:8080
WORKER_SHARED_SECRET: ${WORKER_SHARED_SECRET:-local-worker-secret}
extra_hosts:
- "host.docker.internal:host-gateway"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
web:
build:
context: .
dockerfile: apps/web/Dockerfile
restart: unless-stopped
depends_on:
- api
ports:
- "5173:80"
volumes:
postgres_data:
redis_data: