-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
124 lines (119 loc) · 3.3 KB
/
docker-compose.yml
File metadata and controls
124 lines (119 loc) · 3.3 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
118
119
120
121
122
123
124
services:
frontend-dev:
build:
context: ./app/frontend
dockerfile: Dockerfile.dev
args:
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-/api}
container_name: kcc-cloud-frontend-dev
restart: unless-stopped
user: "0:0"
ports:
- "3000:3000"
volumes:
- ./app/frontend:/app
- /app/node_modules # Preserve installed packages
- /app/.next # Keep cache in container only (not shared with host)
environment:
- TZ=${TZ:-UTC}
- HOME=/app
- XDG_CACHE_HOME=/app/.cache
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-/api}
# For WebSocket: set to accessible backend URL (e.g., http://192.168.178.60:8060)
- NEXT_PUBLIC_WS_URL=${NEXT_PUBLIC_WS_URL:-}
# Backend URL for Next.js rewrites (Docker service name in dev)
- BACKEND_URL=http://backend:8060
- NEXT_PUBLIC_MAX_FILES=${NEXT_PUBLIC_MAX_FILES:-10}
- CHOKIDAR_USEPOLLING=true
- WATCHPACK_POLLING=true
- WATCHPACK_POLLING_INTERVAL=1000
depends_on:
- backend
backend:
build:
context: .
dockerfile: ./app/backend/Dockerfile
args:
USER_ID: ${PUID:-1000}
GROUP_ID: ${PGID:-1000}
container_name: kcc-cloud-backend
restart: unless-stopped
ports:
- "8060:8060"
command: ["gunicorn", "--reload", "-c", "gunicorn_config.py", "wsgi:app"]
volumes:
- ./app/backend/app:/app
- conversion-data:/data
- ./volumes/kindlegen:/app/kindlegen:ro
user: "${PUID:-1000}:${PGID:-1000}"
environment:
- TZ=${TZ:-UTC}
- DATABASE_URL=sqlite:////data/jobs.db
- STORAGE_PATH=/data
- ALLOWED_ORIGINS=*
- FLASK_ENV=${FLASK_ENV:-production}
- FLASK_DEBUG=${FLASK_DEBUG:-0}
- GUNICORN_TIMEOUT=${GUNICORN_TIMEOUT:-600}
- GUNICORN_GRACEFUL_TIMEOUT=${GUNICORN_GRACEFUL_TIMEOUT:-600}
- CELERY_BROKER_URL=redis://redis:6379/0
- MAX_UPLOAD_SIZE=${MAX_UPLOAD_SIZE:-1073741824}
depends_on:
- redis
celery-worker:
build:
context: .
dockerfile: ./app/backend/Dockerfile
args:
USER_ID: ${PUID:-1000}
GROUP_ID: ${PGID:-1000}
command: [
"watchmedo", "auto-restart",
"--recursive",
"--directory=/app",
"--pattern=*.py",
"--",
"celery", "-A", "celery_config.celery_app", "worker",
"--loglevel=info",
"-P", "prefork",
"-c", "${CELERY_CONCURRENCY:-4}",
"-Q", "conversion",
"-E"
]
restart: unless-stopped
volumes:
- ./app/backend/app:/app
- conversion-data:/data
- ./volumes/kindlegen:/app/kindlegen:ro
environment:
- TZ=${TZ:-UTC}
- CELERY_BROKER_URL=redis://redis:6379/0
- DATABASE_URL=sqlite:////data/jobs.db
- STORAGE_PATH=/data
depends_on:
- redis
deploy:
resources:
limits:
cpus: '1.9'
memory: 3G
reservations:
cpus: '1.5'
memory: 2500M
redis:
image: redis:7-alpine
container_name: kcc-cloud-redis
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
volumes:
conversion-data:
driver: local
redis-data:
driver: local