96 lines
2.4 KiB
YAML
96 lines
2.4 KiB
YAML
# Staging topology. Supply real MongoDB replica-set and S3/CDN credentials first.
|
|
name: oudelaa-scale
|
|
x-api: &api
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
target: runtime
|
|
env_file: ${SCALE_ENV_FILE:-.env.scale}
|
|
environment: &api-environment
|
|
NODE_ENV: production
|
|
HOST: 0.0.0.0
|
|
PORT: 4000
|
|
DEPLOYMENT_REPLICAS: 3
|
|
HTTP_TRUSTED_PROXY_CIDRS: 172.30.80.0/24
|
|
REDIS_ENABLED: 'true'
|
|
REDIS_HOST: redis
|
|
REDIS_URL: ''
|
|
REDIS_PASSWORD: ${SCALE_REDIS_PASSWORD:?Set SCALE_REDIS_PASSWORD}
|
|
REDIS_SOCKET_ADAPTER_ENABLED: 'true'
|
|
QUEUE_ENABLED: 'true'
|
|
STORAGE_PROVIDER: s3
|
|
MONGODB_AUTO_INDEX: 'false'
|
|
NOTIFICATION_SERVICE_ENABLED: 'false'
|
|
OUTBOX_DISPATCHER_ENABLED: 'false'
|
|
VIDEO_JOBS_ENABLED: 'true'
|
|
expose: ['4000']
|
|
init: true
|
|
cpus: 2.0
|
|
mem_limit: 1g
|
|
stop_grace_period: 40s
|
|
restart: unless-stopped
|
|
networks: [scale]
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ['CMD', 'wget', '-q', '--spider', 'http://127.0.0.1:4000/api/v1/health/ready']
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 6
|
|
start_period: 30s
|
|
|
|
services:
|
|
api-a: *api
|
|
api-b: *api
|
|
api-c: *api
|
|
video-worker:
|
|
<<: *api
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
target: video-worker
|
|
environment:
|
|
<<: *api-environment
|
|
QUEUE_ENABLED: 'false'
|
|
expose: []
|
|
healthcheck:
|
|
disable: true
|
|
stop_grace_period: 180s
|
|
proxy:
|
|
image: nginx:stable-alpine
|
|
ports: ['127.0.0.1:8080:8080']
|
|
volumes: ['./deploy/nginx.scale.conf:/etc/nginx/nginx.conf:ro']
|
|
networks: [scale]
|
|
restart: unless-stopped
|
|
depends_on:
|
|
api-a: { condition: service_healthy }
|
|
api-b: { condition: service_healthy }
|
|
api-c: { condition: service_healthy }
|
|
redis:
|
|
image: redis:7-alpine
|
|
environment:
|
|
REDIS_PASSWORD: ${SCALE_REDIS_PASSWORD:?Set SCALE_REDIS_PASSWORD}
|
|
command:
|
|
[
|
|
'sh',
|
|
'-c',
|
|
'exec redis-server --requirepass "$$REDIS_PASSWORD" --appendonly yes --maxmemory 512mb --maxmemory-policy noeviction',
|
|
]
|
|
volumes: ['scale_redis:/data']
|
|
networks: [scale]
|
|
mem_limit: 768m
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ['CMD-SHELL', 'REDISCLI_AUTH="$$REDIS_PASSWORD" redis-cli ping | grep -q PONG']
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 12
|
|
|
|
networks:
|
|
scale:
|
|
ipam:
|
|
config: [{ subnet: 172.30.80.0/24 }]
|
|
volumes:
|
|
scale_redis:
|