File size: 1,454 Bytes
85d5e69
 
 
 
 
 
 
df015b8
fff5af9
 
85d5e69
fff5af9
 
 
 
 
df015b8
fff5af9
 
 
 
 
 
 
 
 
df015b8
fff5af9
 
85d5e69
 
 
 
 
 
fff5af9
85d5e69
 
 
 
 
 
 
 
 
 
fff5af9
85d5e69
df015b8
fff5af9
 
85d5e69
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# 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: