Create web/docker-compose.yml
Browse files- web/docker-compose.yml +77 -0
web/docker-compose.yml
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
version: '3.8'
|
2 |
+
|
3 |
+
services:
|
4 |
+
web:
|
5 |
+
build:
|
6 |
+
context: .
|
7 |
+
dockerfile: Dockerfile
|
8 |
+
args:
|
9 |
+
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-http://localhost:8000}
|
10 |
+
- NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL:-http://localhost:3000}
|
11 |
+
- NEXT_PUBLIC_WS_URL=${NEXT_PUBLIC_WS_URL:-ws://localhost:8000}
|
12 |
+
container_name: backgroundfx-web
|
13 |
+
ports:
|
14 |
+
- "3000:3000"
|
15 |
+
environment:
|
16 |
+
- NODE_ENV=production
|
17 |
+
- NEXTAUTH_URL=${NEXTAUTH_URL:-http://localhost:3000}
|
18 |
+
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET}
|
19 |
+
- DATABASE_URL=${DATABASE_URL}
|
20 |
+
- REDIS_URL=${REDIS_URL:-redis://redis:6379}
|
21 |
+
depends_on:
|
22 |
+
- redis
|
23 |
+
networks:
|
24 |
+
- backgroundfx-network
|
25 |
+
restart: unless-stopped
|
26 |
+
healthcheck:
|
27 |
+
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
|
28 |
+
interval: 30s
|
29 |
+
timeout: 10s
|
30 |
+
retries: 3
|
31 |
+
start_period: 40s
|
32 |
+
|
33 |
+
redis:
|
34 |
+
image: redis:7-alpine
|
35 |
+
container_name: backgroundfx-redis
|
36 |
+
ports:
|
37 |
+
- "6379:6379"
|
38 |
+
volumes:
|
39 |
+
- redis-data:/data
|
40 |
+
networks:
|
41 |
+
- backgroundfx-network
|
42 |
+
restart: unless-stopped
|
43 |
+
command: redis-server --appendonly yes
|
44 |
+
healthcheck:
|
45 |
+
test: ["CMD", "redis-cli", "ping"]
|
46 |
+
interval: 10s
|
47 |
+
timeout: 5s
|
48 |
+
retries: 5
|
49 |
+
|
50 |
+
nginx:
|
51 |
+
image: nginx:alpine
|
52 |
+
container_name: backgroundfx-nginx
|
53 |
+
ports:
|
54 |
+
- "80:80"
|
55 |
+
- "443:443"
|
56 |
+
volumes:
|
57 |
+
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
58 |
+
- ./ssl:/etc/nginx/ssl:ro
|
59 |
+
- nginx-cache:/var/cache/nginx
|
60 |
+
depends_on:
|
61 |
+
- web
|
62 |
+
networks:
|
63 |
+
- backgroundfx-network
|
64 |
+
restart: unless-stopped
|
65 |
+
healthcheck:
|
66 |
+
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/health"]
|
67 |
+
interval: 30s
|
68 |
+
timeout: 10s
|
69 |
+
retries: 3
|
70 |
+
|
71 |
+
volumes:
|
72 |
+
redis-data:
|
73 |
+
nginx-cache:
|
74 |
+
|
75 |
+
networks:
|
76 |
+
backgroundfx-network:
|
77 |
+
driver: bridge
|