-
Notifications
You must be signed in to change notification settings - Fork 249
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
125 lines (120 loc) · 3.01 KB
/
Copy pathdocker-compose.yml
File metadata and controls
125 lines (120 loc) · 3.01 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
125
services:
redis:
image: redis:7-alpine
container_name: videoeditor-redis
restart: unless-stopped
command: redis-server --appendonly yes
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
nginx:
image: nginx:alpine
container_name: videoeditor-nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- /etc/letsencrypt:/etc/letsencrypt:ro # Mount certs read-only
depends_on:
redis:
condition: service_healthy
frontend:
condition: service_healthy
backend:
condition: service_healthy
fastapi:
condition: service_healthy
restart: unless-stopped
frontend:
build:
context: .
dockerfile: Dockerfile.frontend
container_name: videoeditor-frontend
env_file:
- .env
environment:
BETTER_AUTH_URL: https://trykimu.com
BACKEND_INTERNAL_URL: http://fastapi:3000
NODE_ENV: production
HOST: 0.0.0.0
PORT: 3000
REDIS_URL: redis://redis:6379/0
# ports:
# - "3000:3000"
depends_on:
redis:
condition: service_healthy
backend:
condition: service_started
healthcheck:
test:
[
"CMD-SHELL",
'node -e "require(''http'').get(''http://127.0.0.1:3000/'', res => process.exit(res.statusCode < 500 ? 0 : 1)).on(''error'', () => process.exit(1))"',
]
interval: 15s
timeout: 5s
retries: 5
start_period: 30s
restart: unless-stopped
backend:
build:
context: .
dockerfile: Dockerfile.backend
container_name: videoeditor-backend
env_file:
- .env
environment:
BETTER_AUTH_URL: https://trykimu.com
NODE_ENV: production
PORT: 8000
REDIS_URL: redis://redis:6379/0
# ports:
# - "8000:8000"
# Remotion + FFmpeg need headroom for 1080p/4K stitch (see remotion.dev/docs/troubleshooting/sigkill)
mem_limit: 4g
memswap_limit: 4g
shm_size: 2g
depends_on:
redis:
condition: service_healthy
healthcheck:
test:
[
"CMD-SHELL",
'node -e "require(''http'').get(''http://127.0.0.1:8000/health'', res => process.exit(res.statusCode === 200 ? 0 : 1)).on(''error'', () => process.exit(1))"',
]
interval: 15s
timeout: 5s
retries: 5
start_period: 30s
restart: unless-stopped
fastapi:
build:
context: ./backend
dockerfile: Dockerfile
container_name: videoeditor-fastapi
env_file:
- .env
environment:
NODE_ENV: production
HOST: 0.0.0.0
PORT: 3000
REDIS_URL: redis://redis:6379/0
depends_on:
redis:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://127.0.0.1:3000/beep >/dev/null"]
interval: 15s
timeout: 5s
retries: 5
start_period: 30s
restart: unless-stopped
volumes:
redis_data: