43 خطوط
1.1 KiB
YAML
43 خطوط
1.1 KiB
YAML
x-service: &service
|
|
build: .
|
|
image: altium-render-engine:local
|
|
init: true
|
|
restart: unless-stopped
|
|
read_only: true
|
|
cap_drop: [ALL]
|
|
security_opt: [no-new-privileges:true]
|
|
tmpfs: ["/tmp:size=256m,mode=1777"]
|
|
mem_limit: 1g
|
|
pids_limit: 128
|
|
env_file: .env
|
|
environment:
|
|
DATABASE_URL: postgresql+psycopg://altium:${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}@db:5432/altium
|
|
STORAGE_DIR: /data
|
|
volumes: [schematics:/data]
|
|
depends_on:
|
|
db: {condition: service_healthy}
|
|
services:
|
|
api:
|
|
<<: *service
|
|
ports: ["127.0.0.1:8000:8000"]
|
|
worker:
|
|
<<: *service
|
|
command: [python, -m, app.worker]
|
|
healthcheck: {disable: true}
|
|
stop_grace_period: 75s
|
|
db:
|
|
image: postgres:16-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: altium
|
|
POSTGRES_DB: altium
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}
|
|
volumes: [postgres:/var/lib/postgresql/data]
|
|
healthcheck:
|
|
test: [CMD-SHELL, "pg_isready -U altium -d altium"]
|
|
interval: 5s
|
|
retries: 20
|
|
volumes:
|
|
postgres:
|
|
schematics:
|