mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 08:21:39 -06:00
45a2ae93c8
Avoid launching a full Node runtime every 30 seconds so idle containers do not create unnecessary CPU, memory, and disk pressure. Let Compose inherit the image probe to keep one source of truth. Closes #1129
71 lines
1.9 KiB
YAML
71 lines
1.9 KiB
YAML
name: bookorbit
|
|
|
|
services:
|
|
app:
|
|
container_name: bookorbit-app
|
|
image: ${APP_IMAGE?required}
|
|
restart: unless-stopped
|
|
init: true
|
|
env_file:
|
|
- .env
|
|
ports:
|
|
- "${APP_PORT:-3000}:${PORT:-3000}"
|
|
environment:
|
|
NODE_ENV: production
|
|
PORT: ${PORT:-3000}
|
|
DATABASE_URL: ${DATABASE_URL:-}
|
|
POSTGRES_HOST: ${POSTGRES_HOST:-postgres}
|
|
POSTGRES_PORT: ${POSTGRES_PORT:-5432}
|
|
POSTGRES_USER: ${POSTGRES_USER?required}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD?required}
|
|
POSTGRES_DB: ${POSTGRES_DB?required}
|
|
JWT_SECRET: ${JWT_SECRET?required}
|
|
SETUP_BOOTSTRAP_TOKEN: ${SETUP_BOOTSTRAP_TOKEN?required}
|
|
APP_URL: ${APP_URL?required}
|
|
CLIENT_URL: ${CLIENT_URL:-${APP_URL?required}}
|
|
TZ: ${TZ:-UTC}
|
|
PUID: ${PUID:-1000}
|
|
PGID: ${PGID:-1000}
|
|
NODE_MAX_OLD_SPACE_SIZE: ${NODE_MAX_OLD_SPACE_SIZE:-auto}
|
|
BOOK_DOCK_PATH: ${BOOK_DOCK_PATH:-}
|
|
LIBRARY_BROWSE_ROOT: ${LIBRARY_BROWSE_ROOT:-}
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
volumes:
|
|
- ${BOOKS_HOST_PATH:-./books}:/books
|
|
- ./data/app:/data
|
|
read_only: true
|
|
tmpfs:
|
|
- /tmp
|
|
cap_drop:
|
|
- ALL
|
|
cap_add:
|
|
- CHOWN
|
|
- DAC_OVERRIDE
|
|
- FOWNER
|
|
- SETGID
|
|
- SETUID
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
stop_grace_period: 30s
|
|
|
|
postgres:
|
|
container_name: bookorbit-db
|
|
image: pgvector/pgvector:pg18
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER?required}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD?required}
|
|
POSTGRES_DB: ${POSTGRES_DB?required}
|
|
PGDATA: /var/lib/postgresql/data/pgdata
|
|
volumes:
|
|
- ./data/postgres:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test:
|
|
["CMD-SHELL", 'pg_isready -U "$${POSTGRES_USER}" -d "$${POSTGRES_DB}"']
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 10
|
|
start_period: 20s
|