98 lines
2.7 KiB
YAML
98 lines
2.7 KiB
YAML
x-app-environment: &app-environment
|
|
HOSTNAME: 0.0.0.0
|
|
PORT: "3000"
|
|
DATABASE_URL: postgresql://prompt:${POSTGRES_PASSWORD:?Set a unique PostgreSQL password}@postgres:5432/prompt
|
|
S3_ENDPOINT: http://objects:9000
|
|
S3_ACCESS_KEY: ${S3_ACCESS_KEY:?Set a unique S3 access key}
|
|
S3_SECRET_KEY: ${S3_SECRET_KEY:?Set a unique S3 secret key}
|
|
S3_BUCKET: ${S3_BUCKET:-prompt}
|
|
RELEASE_SHA: ${RELEASE_SHA:-development}
|
|
FFMPEG_PATH: /usr/bin/ffmpeg
|
|
FFPROBE_PATH: /usr/bin/ffprobe
|
|
|
|
x-app: &app
|
|
image: ${PROMPT_IMAGE:-prompt:local}
|
|
restart: unless-stopped
|
|
environment: *app-environment
|
|
init: true
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
cap_drop: [ALL]
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
objects:
|
|
condition: service_started
|
|
|
|
services:
|
|
web:
|
|
<<: *app
|
|
ports:
|
|
- "${WEB_BIND_ADDRESS:-0.0.0.0}:${WEB_PORT:-18131}:3000"
|
|
healthcheck:
|
|
test: ["CMD", "node", "container-health.mjs"]
|
|
interval: 5s
|
|
timeout: 8s
|
|
retries: 24
|
|
start_period: 10s
|
|
worker:
|
|
<<: *app
|
|
command: ["node", "worker.cjs"]
|
|
stop_grace_period: 11m
|
|
healthcheck:
|
|
test: ["CMD", "node", "-e", "const f=require('fs');try{if(Date.now()-f.statSync('/tmp/prompt-worker-health').mtimeMs>60000)process.exit(1)}catch{process.exit(1)}"]
|
|
interval: 15s
|
|
timeout: 5s
|
|
retries: 4
|
|
start_period: 10s
|
|
migrate:
|
|
<<: *app
|
|
profiles: [tools]
|
|
restart: "no"
|
|
command: ["node", "bootstrap.cjs"]
|
|
tests:
|
|
image: ${PROMPT_TEST_IMAGE:-prompt:tests}
|
|
profiles: [tools]
|
|
init: true
|
|
environment:
|
|
<<: *app-environment
|
|
PROMPT_INTEGRATION_TEST: "1"
|
|
PROMPT_TEST_BASE_URL: http://web:3000
|
|
depends_on:
|
|
web:
|
|
condition: service_healthy
|
|
worker:
|
|
condition: service_healthy
|
|
postgres:
|
|
image: postgres:17-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_DB: prompt
|
|
POSTGRES_USER: prompt
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set a unique PostgreSQL password}
|
|
ports:
|
|
- "127.0.0.1:${PG_PORT:-18132}:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U prompt -d prompt"]
|
|
interval: 3s
|
|
timeout: 3s
|
|
retries: 30
|
|
objects:
|
|
image: rustfs/rustfs:1.0.3
|
|
restart: unless-stopped
|
|
environment:
|
|
RUSTFS_ACCESS_KEY: ${S3_ACCESS_KEY:?Set a unique S3 access key}
|
|
RUSTFS_SECRET_KEY: ${S3_SECRET_KEY:?Set a unique S3 secret key}
|
|
RUSTFS_VOLUMES: /data
|
|
RUSTFS_ADDRESS: ":9000"
|
|
RUSTFS_CONSOLE_ENABLE: "false"
|
|
ports:
|
|
- "127.0.0.1:${S3_PORT:-18133}:9000"
|
|
volumes:
|
|
- objects:/data
|
|
volumes:
|
|
postgres_data:
|
|
objects:
|