-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
72 lines (64 loc) · 2.05 KB
/
docker-compose.yml
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
version: "3.8"
services:
# MongoDB service
enhanced-todo-app-mongodb:
image: mongo:latest
container_name: enhanced-todo-app-mongodb
environment:
- MONGO_INITDB_ROOT_USERNAME=mongodb
- MONGO_INITDB_ROOT_PASSWORD=pLSkczmWBHK0CVh
- MONGO_INITDB_DATABASE=todo
volumes:
- /home/ubuntu/mongo-data:/data/db # Persist MongoDB data
ports:
- "27017:27017" # Expose MongoDB on default port
networks:
- app-network
restart: always
# Backend service (Node.js)
enhanced-todo-app-backend:
build:
context: ./backend # Directory where your backend Dockerfile is located
container_name: enhanced-todo-app-backend
environment:
- PORT=3000
- MONGODB_USER=mongodb
- MONGODB_PASSWORD=pLSkczmWBHK0CVh
- MONGODB_HOST=enhanced-todo-app-mongodb
- MONGODB_PORT=27017
- MONGODB_DATABASE=todo
- JWT_SECRET=thisisasamplesecret
- JWT_ACCESS_EXPIRATION_MINUTES=60
- JWT_REFRESH_EXPIRATION_DAYS=60
- JWT_RESET_PASSWORD_EXPIRATION_MINUTES=60
- JWT_VERIFY_EMAIL_EXPIRATION_MINUTES=60
- SMTP_HOST=smtp.sendgrid.net
- SMTP_PORT=587
- SMTP_USERNAME=apikey
- SMTP_PASSWORD=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
ports:
- "3000:3000" # Expose backend on port 5000
depends_on:
- enhanced-todo-app-mongodb # Ensures MongoDB is started before the backend
networks:
- app-network
restart: always
# Frontend service (React)
enhanced-todo-app-frontend:
build:
context: ./frontend # Directory where your frontend Dockerfile is located
args:
- VITE_API_BASE_URL=http://localhost:3000/v1
container_name: enhanced-todo-app-frontend
ports:
- "8080:8080" # Expose frontend on port 3000
depends_on:
- enhanced-todo-app-backend # Ensures backend is started before the frontend
networks:
- app-network
restart: always
# Networks for services communication
networks:
app-network:
driver: bridge