docker-compose.yml RawHistoryFolder
1# Gordon v2 - Docker Compose Deployment Example
2# Complete containerized deployment with proper networking
3
4version: '3.8'
5
6services:
7 # Main Gordon service
8 gordon:
9 image: gordon:latest
10 container_name: gordon
11 restart: unless-stopped
12
13 # Port mapping for Cloudflare → Gordon
14 ports:
15 - "80:8080" # HTTP traffic (Cloudflare terminates SSL)
16 - "443:8080" # HTTPS traffic (Cloudflare → HTTP to Gordon)
17
18 volumes:
19 # Docker socket access for container management
20 - /var/run/docker.sock:/var/run/docker.sock
21
22 # Data persistence
23 - ./gordon-data:/data
24
25 # Configuration
26 - ./gordon.toml:/app/gordon.toml:ro
27
28 # Optional: Mount Docker registry data
29 - ./registry-data:/data/registry
30
31 environment:
32 - GORDON_LOG_LEVEL=info
33 - GORDON_CONFIG=/app/gordon.toml
34
35 # Health check
36 healthcheck:
37 test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8080/health"]
38 interval: 30s
39 timeout: 10s
40 retries: 3
41 start_period: 40s
42
43 networks:
44 - gordon-network
45
46 # Security
47 user: "1000:1000" # Run as non-root user
48
49 # Resource limits (optional)
50 deploy:
51 resources:
52 limits:
53 memory: 512M
54 cpus: '0.5'
55 reservations:
56 memory: 256M
57 cpus: '0.25'
58
59 # Optional: Monitoring with Prometheus
60 prometheus:
61 image: prom/prometheus:latest
62 container_name: gordon-prometheus
63 restart: unless-stopped
64 ports:
65 - "9090:9090"
66 volumes:
67 - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
68 - prometheus-data:/prometheus
69 command:
70 - '--config.file=/etc/prometheus/prometheus.yml'
71 - '--storage.tsdb.path=/prometheus'
72 - '--web.console.libraries=/etc/prometheus/console_libraries'
73 - '--web.console.templates=/etc/prometheus/consoles'
74 - '--web.enable-lifecycle'
75 networks:
76 - gordon-network
77
78 # Optional: Grafana dashboard
79 grafana:
80 image: grafana/grafana:latest
81 container_name: gordon-grafana
82 restart: unless-stopped
83 ports:
84 - "3000:3000"
85 volumes:
86 - grafana-data:/var/lib/grafana
87 environment:
88 - GF_SECURITY_ADMIN_PASSWORD=admin123
89 networks:
90 - gordon-network
91
92networks:
93 gordon-network:
94 driver: bridge
95 ipam:
96 config:
97 - subnet: 172.20.0.0/16
98
99volumes:
100 prometheus-data:
101 grafana-data:
102
103# Usage:
104# 1. Create gordon.toml with your configuration
105# 2. Run: docker-compose up -d
106# 3. Check health: docker-compose ps
107# 4. View logs: docker-compose logs -f gordon
108# 5. Scale if needed: docker-compose up -d --scale gordon=2