Files
fm_be/docker-compose.yml
2026-07-16 22:16:45 +07:00

87 lines
2.1 KiB
YAML

# This stack runs API, email worker, and file worker containers.
# Ensure envs in .env point to endpoints reachable from inside containers.
# In particular, MYSQL_DSN/SQS/SES values using 127.0.0.1 will not work unless they are
# changed to a host or service name that containers can reach.
services:
api:
build:
context: .
dockerfile: Dockerfile
target: api
image: localhost/wucher-api:dev
env_file:
- .env
environment:
HTTP_PORT: "8080"
ports:
- "8080:8080"
restart: unless-stopped
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
healthcheck:
test: ["CMD", "/app/healthcheck", "http://127.0.0.1:8080/health"]
interval: 30s
timeout: 3s
start_period: 20s
retries: 3
worker:
build:
context: .
dockerfile: Dockerfile
target: worker
image: localhost/wucher-worker:dev
env_file:
- .env
environment:
# Bind to all interfaces so the monitor endpoint can be reached from the host.
QUEUE_WORKER_MONITOR_ADDR: "0.0.0.0:9090"
WORKER_JOB: "email"
ports:
- "9090:9090"
restart: unless-stopped
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
healthcheck:
test: ["CMD", "/app/healthcheck", "http://127.0.0.1:9090/health"]
interval: 30s
timeout: 3s
start_period: 20s
retries: 3
gotenberg:
image: gotenberg/gotenberg:8
ports:
- "3000:3000"
restart: unless-stopped
file-worker:
build:
context: .
dockerfile: Dockerfile
target: file-worker
image: localhost/wucher-file-worker:dev
env_file:
- .env
environment:
# Bind to all interfaces so the monitor endpoint can be reached from the host.
QUEUE_WORKER_MONITOR_ADDR: "0.0.0.0:9091"
WORKER_JOB: "file_processing"
ports:
- "9091:9091"
restart: unless-stopped
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
healthcheck:
test: ["CMD", "/app/healthcheck", "http://127.0.0.1:9091/health"]
interval: 30s
timeout: 3s
start_period: 20s
retries: 3