-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
77 lines (72 loc) · 1.62 KB
/
Copy pathdocker-compose.yml
File metadata and controls
77 lines (72 loc) · 1.62 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
version: '3.8'
services:
# MongoDB Database
mongodb:
image: mongo:7
container_name: gigflow-mongodb
restart: unless-stopped
ports:
- '27017:27017'
volumes:
- mongo-data:/data/db
environment:
MONGO_INITDB_DATABASE: gigflow
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh --quiet
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
networks:
- gigflow-network
# Backend API
backend:
build:
context: ./server
dockerfile: Dockerfile
container_name: gigflow-backend
restart: unless-stopped
ports:
- '5000:5000'
environment:
PORT: 5000
MONGODB_URI: mongodb://mongodb:27017/gigflow
JWT_SECRET: ${JWT_SECRET:-gigflow-super-secret-key-change-in-production}
CLIENT_URL: http://localhost:3000
depends_on:
mongodb:
condition: service_healthy
healthcheck:
test: wget -qO- http://localhost:5000/api/health || exit 1
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
networks:
- gigflow-network
# Frontend (Nginx)
frontend:
build:
context: ./client
dockerfile: Dockerfile
container_name: gigflow-frontend
restart: unless-stopped
ports:
- '3000:80'
depends_on:
backend:
condition: service_healthy
healthcheck:
test: wget -qO- http://localhost:80/ || exit 1
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
networks:
- gigflow-network
volumes:
mongo-data:
driver: local
networks:
gigflow-network:
driver: bridge