gen / docker-compose.yml
AnesKAM's picture
Upload 76 files
85d5e69 verified
Raw History Blame Contribute Delete
1.45 kB
# Fox Search — self-hosted stack.
#
# Default: the app alone, data in a named volume (no database needed).
# docker compose up -d --build
#
# With PostgreSQL instead of the JSON store:
# docker compose --profile postgres up -d --build
services:
db:
image: postgres:16-alpine
profiles: ["postgres"]
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: app_db
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d app_db"]
interval: 5s
timeout: 5s
retries: 12
web:
build: .
restart: unless-stopped
environment:
NODE_ENV: production
PORT: "7860"
# Uncomment both lines (and start with --profile postgres) to use PostgreSQL.
# DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD:-postgres}@db:5432/app_db
# PG_POOL_MAX: "10"
# Only set this when the platform does not inject DATABASE_URL automatically:
# FOX_DATA_DIR: /data
ports:
- "7860:7860"
volumes:
# Survives `docker compose down` and image rebuilds.
- foxdata:/data
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:7860/api/health >/dev/null || exit 1"]
interval: 30s
timeout: 5s
retries: 5
start_period: 20s
depends_on:
- db
volumes:
pgdata:
foxdata: