-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcompose.yaml
105 lines (102 loc) · 2.39 KB
/
compose.yaml
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
services:
# Fontend: NextJs
frontend:
env_file:
- ./frontend/.env.production
container_name: nextpalestine-frontend
image: nextpalestine-frontend
build:
context: ./frontend
dockerfile: Dockerfile
args:
- DOCKER_BUILDKIT=1
ports:
- 3540:3540
restart: unless-stopped
depends_on:
backend:
condition: service_healthy
volumes:
- /app/node_modules
# For live reload if the source or env changes
- ./frontend/src:/app/src
networks:
- app-network
# Backend: NestJS
backend:
container_name: nextpalestine-backend
image: nextpalestine-backend
env_file:
- ./backend/.env.production
build:
context: ./backend
dockerfile: Dockerfile
args:
- DOCKER_BUILDKIT=1
ports:
- 3500:3500
restart: unless-stopped
depends_on:
mongodb:
condition: service_healthy
volumes:
- backend_v_logs:/app/logs
- backend_v_public:/app/public
- /app/node_modules
# For live reload if the source or env changes
- ./backend/src:/app/src
healthcheck:
test: ["CMD-SHELL", "curl -f http://backend:3500/health || exit 1"]
interval: 5s
timeout: 5s
retries: 5
start_period: 20s
networks:
- app-network
# Database: Mongodb
mongodb:
container_name: mongodb
image: mongo:latest
restart: unless-stopped
ports:
- 27018:27017
env_file:
- ./backend/.env.production
networks:
- app-network
volumes:
- mongodb_data:/data/db
- /etc/timezone:/etc/timezone:ro
#- type: bind
# source: ./mongo-entrypoint
# target: /docker-entrypoint-initdb.d/
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 5s
timeout: 5s
retries: 5
start_period: 20s
# Database UI: Mongo Express
mongo-express:
image: mongo-express:1.0.2-20-alpine3.19
container_name: mongo-express
restart: always
ports:
- 8081:8081
env_file:
- ./backend/.env.production
depends_on:
- mongodb
networks:
- app-network
volumes:
backend_v_logs:
name: nextpalestine_v_backend_logs
backend_v_public:
name: nextpalestine_v_backend_public
mongodb_data:
name: nextpalestine_v_mongodb_data
driver: local
networks:
app-network:
driver: bridge