-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
78 lines (72 loc) · 1.56 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
73
74
75
76
77
78
version: "3.9"
services:
# database for storing data
database:
container_name: "${APP_PREFIX}-db"
image: mongo:7.0
environment:
- MONGO_INITDB_ROOT_USERNAME=admin
- MONGO_INITDB_ROOT_PASSWORD=passpass
networks:
- app-network
volumes:
- type: bind
source: ./data
target: /data/db
- data:/data/db
# Secondary mongo database container for managing data
dbsh:
container_name: "${APP_PREFIX}-dbsh"
depends_on:
- database
environment:
- MONGO_HOST=database
- MONGO_INITDB_ROOT_USERNAME=admin
- MONGO_INITDB_ROOT_PASSWORD=passpass
image: mongo:7.0
networks:
- app-network
volumes:
- type: bind
source: ./data
target: /data/db
# server for handling requests
server:
build:
context: ./server
dockerfile: Dockerfile
container_name: "${APP_PREFIX}-server"
env_file:
- .env
networks:
- app-network
ports:
- "8080:8080"
- "3000:3000"
volumes:
- ./server:/usr/src/app
- ./app:/usr/src/web
- /usr/src/app/node_modules
# node service for React app
app:
build:
context: ./src
dockerfile: Dockerfile
container_name: "${APP_PREFIX}-app"
env_file:
- .env
depends_on:
- database
- server
networks:
- app-network
volumes:
- ./src:/usr/src/web
- /usr/src/web/node_modules
# network for communication between containers
networks:
app-network:
driver: bridge
# volumes for persisting data
volumes:
data: