This repository was archived by the owner on Jul 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose-dev.yml
More file actions
58 lines (54 loc) · 1.45 KB
/
docker-compose-dev.yml
File metadata and controls
58 lines (54 loc) · 1.45 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
version: "3.9"
volumes:
mongo_data_dev:
services:
frontend:
restart: always
build:
context: ./frontend
dockerfile: Dockerfile.dev
ports:
- 3000:3000
environment:
- REACT_APP_API_URL=${REACT_APP_API_URL:-http://localhost:4000/}
volumes:
- ./frontend:/app/frontend
- /app/frontend/node_modules
mongo:
image: mongo:6.0
restart: always
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGO_USERNAME:-devuser}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD:-somepass}
- MONGO_INITDB_DATABASE=${MONGO_DBNAME:-TodoDB}
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh mongodb://mongo/test --quiet
interval: 2s
timeout: 2s
retries: 10
start_period: 2s
volumes:
- mongo_data_dev:/data/db
nodejs:
depends_on:
mongo:
condition: service_healthy
restart: always
build:
context: ./backend/nodejs
dockerfile: Dockerfile.dev
volumes:
- /app/nodejs/node_modules
- /app/nodejs/dist
- ./backend/nodejs:/app/nodejs
environment:
- MONGODB_URL=mongodb://mongo/
- MONGODB_USER=${MONGO_USERNAME:-devuser}
- MONGODB_PASS=${MONGO_PASSWORD:-somepass}
- MONGODB_DBNAME=${MONGO_DBNAME:-TodoDB}
- JWT_SECRET=${JWT_SECRET:-jwtsecret}
- NODE_ENV=development
- PORT=4000
- FRONTEND_URL=${FRONTEND_URL:-http://localhost:3000}
ports:
- 4000:4000