-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.example.yml
More file actions
117 lines (111 loc) · 3.44 KB
/
docker-compose.example.yml
File metadata and controls
117 lines (111 loc) · 3.44 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Hermes Production Stack using Pre-built Images
# This example uses the latest published Docker images from GitHub Container Registry
#
# Quick Start:
# 1. Copy this file to docker-compose.yml
# 2. Copy .env.example to .env and configure your settings
# 3. Run: docker compose up -d
# 4. Access at http://localhost:3000
#
# For building from source instead, see docker-compose.yml
services:
# Frontend - using pre-built image with nginx, proxying /api to the backend
app:
image: ghcr.io/techsquidtv/hermes-app:latest
container_name: hermes-app
restart: unless-stopped
ports:
- "${HERMES_PORT:-3000}:80"
environment:
# Optional: Configure API base URL at runtime
# Examples:
# - Same domain (default): /api/v1
# - Separate subdomain: https://api.hermes.example.com/api/v1
# - Different domain: https://hermes-api.mydomain.com/api/v1
- VITE_API_BASE_URL=${VITE_API_BASE_URL:-/api/v1}
networks:
- hermes-network
depends_on:
api:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1/"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
# Backend API - using pre-built image
api:
image: ghcr.io/techsquidtv/hermes-api:latest
container_name: hermes-api
restart: unless-stopped
env_file:
- .env
environment:
- HERMES_SECRET_KEY=${HERMES_SECRET_KEY}
- HERMES_REDIS_URL=${HERMES_REDIS_URL:-redis://redis:6379}
volumes:
- ./data/downloads:/app/downloads
- ./data/temp:/app/temp
- ./data/data:/app/data
networks:
- hermes-network
depends_on:
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/v1/health/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Celery worker for background tasks - using pre-built image
celery_worker:
image: ghcr.io/techsquidtv/hermes-api:latest
container_name: hermes-worker
restart: unless-stopped
env_file:
- .env
environment:
- HERMES_SECRET_KEY=${HERMES_SECRET_KEY}
- HERMES_REDIS_URL=${HERMES_REDIS_URL:-redis://redis:6379}
volumes:
- ./data/downloads:/app/downloads
- ./data/temp:/app/temp
- ./data/data:/app/data
networks:
- hermes-network
depends_on:
redis:
condition: service_healthy
api:
condition: service_healthy
# Run celery directly from venv to avoid uv run re-installing dev dependencies
command: celery -A app.tasks.celery_app worker --loglevel=info --concurrency=1 --hostname=hermes-worker@%h --queues=hermes.downloads,hermes.cleanup,hermes.default
healthcheck:
test: ["CMD", "celery", "-A", "app.tasks.celery_app", "inspect", "ping"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
# Redis for caching and task queue
redis:
image: redis:8-alpine
container_name: hermes-redis
restart: unless-stopped
volumes:
- redis_data:/data
networks:
- hermes-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 3
start_period: 5s
command: redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru
networks:
hermes-network:
driver: bridge
volumes:
redis_data: # Redis data persistence