File size: 1,342 Bytes
ed57015
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Cloud / VPS deployment compose file
# Usage: docker compose -f docker-compose.cloud.yml up -d
#
# This compose file:
#   - Builds from source (no pre-built image required)
#   - Exposes the API publicly on port 3001 (0.0.0.0)
#   - Uses a named Docker volume for persistent SQLite storage
#   - Automatically restarts on crash / VPS reboot
#   - Runs the local catalog crawl + Elo ranking every 12 hours (no license needed)

services:
  freellmapi:
    build:
      context: .
      dockerfile: Dockerfile
    env_file:
      - .env
    environment:
      NODE_ENV: production
      PORT: 3001
      HOST_BIND: "0.0.0.0"
      # Disables the upstream premium catalog sync and enables the local
      # crawler pipeline (fetcher.py → sync_freellmapi.py → rank_models.py)
      CATALOG_SYNC_DISABLED: "1"
    ports:
      # Exposed on all interfaces — place behind Nginx/Caddy for HTTPS
      - "0.0.0.0:3001:3001"
    volumes:
      - freellmapi-data:/app/server/data
    restart: unless-stopped
    healthcheck:
      test:
        [
          "CMD",
          "node",
          "-e",
          "fetch('http://127.0.0.1:3001/api/ping').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1));"
        ]
      interval: 30s
      timeout: 5s
      start_period: 30s
      retries: 3

volumes:
  freellmapi-data: