70 lines
1.8 KiB
YAML
70 lines
1.8 KiB
YAML
services:
|
|
db:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_USER: mercury
|
|
POSTGRES_PASSWORD: mercury
|
|
POSTGRES_DB: mercury
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U mercury"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
cdn:
|
|
image: minio/minio
|
|
command: server /data --console-address ":9001"
|
|
environment:
|
|
MINIO_ROOT_USER: mercury
|
|
MINIO_ROOT_PASSWORD: mercurycdn
|
|
volumes:
|
|
- cdn_data:/data
|
|
healthcheck:
|
|
test: ["CMD", "mc", "ready", "local"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
cdn-init:
|
|
image: minio/mc
|
|
depends_on:
|
|
cdn:
|
|
condition: service_healthy
|
|
entrypoint: >
|
|
/bin/sh -c "
|
|
mc alias set local http://cdn:9000 mercury mercurycdn &&
|
|
mc mb --ignore-existing local/mercury &&
|
|
mc anonymous set public local/mercury &&
|
|
echo 'CDN bucket ready'
|
|
"
|
|
restart: on-failure
|
|
|
|
api:
|
|
build: .
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
DATABASE_URL: postgres://mercury:mercury@db:5432/mercury
|
|
JWT_SECRET: ${JWT_SECRET:-change_me_in_production}
|
|
JWT_EXPIRY_SECS: ${JWT_EXPIRY_SECS:-3600}
|
|
CACHE_MAX_CAPACITY: ${CACHE_MAX_CAPACITY:-10000}
|
|
CACHE_IDLE_TIMEOUT_SECS: ${CACHE_IDLE_TIMEOUT_SECS:-300}
|
|
CACHE_SWEEP_INTERVAL_SECS: ${CACHE_SWEEP_INTERVAL_SECS:-60}
|
|
CDN_ENDPOINT: http://cdn:9000
|
|
CDN_BUCKET: mercury
|
|
DISABLE_AUTH: ${DISABLE_AUTH:-false}
|
|
MERCURY_ADMIN_USER: test
|
|
MERCURY_ADMIN_PASSWORD: test
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
cdn:
|
|
condition: service_healthy
|
|
mem_limit: 512m
|
|
mem_reservation: 256m
|
|
|
|
volumes:
|
|
postgres_data:
|
|
cdn_data:
|