-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
117 lines (112 loc) · 2.78 KB
/
docker-compose.yml
File metadata and controls
117 lines (112 loc) · 2.78 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
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
106
107
108
109
110
111
112
113
114
115
116
117
services:
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- "3000:3000"
volumes:
- ./frontend:/app
- /app/node_modules
environment:
- NODE_ENV=development
- NEXT_PUBLIC_API_URL=http://localhost:5001/api
depends_on:
backend:
condition: service_healthy
networks:
- topbudget-network
stdin_open: true
tty: true
restart: unless-stopped
backend:
build:
context: ./backend
dockerfile: Dockerfile
target: development
ports:
- "5001:5001"
volumes:
- ./backend:/app
- /app/node_modules
environment:
- NODE_ENV=development
- MONGO_URI=mongodb://${MONGO_USER}:${MONGO_PASSWORD}@mongo:27017/topbudget?authSource=admin
- JWT_SECRET=${JWT_SECRET}
- PORT=5001
- MONGO_USER=${MONGO_USER}
- MONGO_PASSWORD=${MONGO_PASSWORD}
depends_on:
mongo:
condition: service_healthy
networks:
- topbudget-network
healthcheck:
test:
[
"CMD",
"wget",
"--quiet",
"--tries=1",
"--spider",
"http://localhost:5001/api/health",
]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
restart: unless-stopped
mongo:
image: mongo:6
container_name: mongodb
restart: unless-stopped
environment:
- MONGO_INITDB_DATABASE=topbudget
- MONGO_INITDB_ROOT_USERNAME=${MONGO_USER}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD}
ports:
- "27017:27017"
volumes:
- mongo-data:/data/db
networks:
- topbudget-network
healthcheck:
test: mongosh --eval 'db.runCommand("ping").ok' mongodb://${MONGO_USER}:${MONGO_PASSWORD}@localhost:27017/admin --quiet
interval: 10s
timeout: 10s
retries: 5
start_period: 40s
command: ["--quiet", "--logpath=/dev/null"]
logging:
driver: "none"
mongo-express:
image: mongo-express
restart: unless-stopped
ports:
- "8081:8081"
environment:
ME_CONFIG_MONGODB_SERVER: mongo
ME_CONFIG_MONGODB_PORT: 27017
ME_CONFIG_MONGODB_ADMINUSERNAME: ${MONGO_USER}
ME_CONFIG_MONGODB_ADMINPASSWORD: ${MONGO_PASSWORD}
ME_CONFIG_BASICAUTH_USERNAME: ${ME_CONFIG_BASICAUTH_USERNAME}
ME_CONFIG_BASICAUTH_PASSWORD: ${ME_CONFIG_BASICAUTH_PASSWORD}
ME_CONFIG_BASICAUTH: "true"
ME_CONFIG_MONGODB_ENABLE_ADMIN: "true"
depends_on:
mongo:
condition: service_healthy
networks:
- topbudget-network
volumes:
mongo-data:
name: topbudget_mongo_data
networks:
topbudget-network:
name: topbudget_network
driver: bridge