-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
88 lines (83 loc) · 2.43 KB
/
docker-compose.yml
File metadata and controls
88 lines (83 loc) · 2.43 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# AutoRouter Production Docker Compose
#
# Usage:
# 1. Copy this file to your server: /opt/autorouter/docker-compose.yml
# 2. Create .env file with required variables (see .env.example)
# 3. Run: docker compose up -d
#
# For CI/CD deployment, GitHub Actions will automatically update IMAGE_TAG
services:
autorouter:
image: ghcr.io/g1331/autorouter:${IMAGE_TAG:-latest}
container_name: autorouter
restart: unless-stopped
ports:
- "${PORT:-3331}:3000"
environment:
- NODE_ENV=production
- DATABASE_URL=${DATABASE_URL}
- ENCRYPTION_KEY=${ENCRYPTION_KEY}
- ADMIN_TOKEN=${ADMIN_TOKEN}
- ALLOW_KEY_REVEAL=${ALLOW_KEY_REVEAL:-false}
- LOG_RETENTION_DAYS=${LOG_RETENTION_DAYS:-90}
- CORS_ORIGINS=${CORS_ORIGINS:-}
- RECORDER_ENABLED=${RECORDER_ENABLED:-true}
- RECORDER_FIXTURES_DIR=${RECORDER_FIXTURES_DIR:-tests/fixtures}
- RECORDER_REDACT_SENSITIVE=${RECORDER_REDACT_SENSITIVE:-false}
- RECORDER_MODE=${RECORDER_MODE:-failure}
volumes:
- autorouter-data:/app/data
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- autorouter-net
depends_on:
db:
condition: service_healthy
db:
image: postgres:16-alpine
container_name: autorouter-db
restart: unless-stopped
networks:
- autorouter-net
environment:
- POSTGRES_USER=${POSTGRES_USER:-autorouter}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB:-autorouter}
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test:
["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-autorouter} -d ${POSTGRES_DB:-autorouter}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
# Uncomment to expose PostgreSQL port (for debugging only)
# ports:
# - "5432:5432"
volumes:
autorouter-data:
postgres-data:
networks:
autorouter-net:
driver: bridge
name: autorouter-net
# Optional: Add reverse proxy (uncomment if needed)
# services:
# nginx:
# image: nginx:alpine
# container_name: autorouter-nginx
# restart: unless-stopped
# ports:
# - "80:80"
# - "443:443"
# volumes:
# - ./nginx.conf:/etc/nginx/nginx.conf:ro
# - ./certs:/etc/nginx/certs:ro
# depends_on:
# - autorouter