-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
49 lines (45 loc) · 1.06 KB
/
docker-compose.yml
File metadata and controls
49 lines (45 loc) · 1.06 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
version: "3.8"
services:
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis-data:/data
command: redis-server --maxmemory 128mb --maxmemory-policy allkeys-lru
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
backend:
build:
context: .
dockerfile: backend/Dockerfile
ports:
- "3001:3001"
environment:
- NODE_ENV=production
- BACKEND_PORT=3001
- REDIS_URL=redis://redis:6379
- TANKERKOENIG_API_KEY=${TANKERKOENIG_API_KEY}
depends_on:
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://localhost:3001/api/health').then(r=>{if(!r.ok)throw 1}).catch(()=>process.exit(1))"]
interval: 30s
timeout: 10s
retries: 3
frontend:
build:
context: .
dockerfile: frontend/Dockerfile
ports:
- "3000:3000"
environment:
- NEXT_PUBLIC_API_URL=http://backend:3001
depends_on:
- backend
volumes:
redis-data: