Files
ict-warehouse-allocation/deploy/compose.server.yaml
T

81 lines
1.7 KiB
YAML

name: warehouse-allocation
x-api-common: &api-common
environment:
WA_ENVIRONMENT: production
WA_INVENTORY_BACKEND: redis
WA_REDIS_URL: redis://redis:6379/0
WA_REDIS_SOCKET_TIMEOUT_SECONDS: "0.08"
WA_MAX_CANDIDATE_WAREHOUSES: "33"
WA_INVENTORY_ADMIN_TOKEN: ${WA_INVENTORY_ADMIN_TOKEN:?inventory admin token is required}
restart: unless-stopped
read_only: true
tmpfs:
- /tmp:size=32m,mode=1777
security_opt:
- no-new-privileges:true
mem_limit: 384m
healthcheck:
test:
- CMD
- python
- -c
- "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/health/ready', timeout=1)"
interval: 5s
timeout: 2s
retries: 10
start_period: 10s
logging:
driver: json-file
options:
max-size: 10m
max-file: "3"
services:
api-blue:
<<: *api-common
image: ${BLUE_IMAGE:?blue image is required}
profiles: [blue]
ports:
- "127.0.0.1:18081:8080"
api-green:
<<: *api-common
image: ${GREEN_IMAGE:?green image is required}
profiles: [green]
ports:
- "127.0.0.1:18082:8080"
redis:
image: redis:7.4-alpine
command:
- redis-server
- --appendonly
- "yes"
- --appendfsync
- everysec
- --maxmemory
- 384mb
- --maxmemory-policy
- noeviction
volumes:
- redis-data:/data
restart: unless-stopped
mem_limit: 512m
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 2s
retries: 10
security_opt:
- no-new-privileges:true
logging:
driver: json-file
options:
max-size: 10m
max-file: "3"
volumes:
redis-data: