-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdocker-compose.yml
69 lines (64 loc) · 1.68 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
version: '3.1'
services:
# mongodb installation (it generates the "data" subdir in the project)
mongodb:
image: mongo:5.0.8
restart: on-failure
volumes:
- ./data/db:/data/db
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
# development only dashboard for easily checking db changes
mongo-express:
image: mongo-express:1.0.0-alpha.4
restart: always
ports:
- "8081:8081"
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: root
ME_CONFIG_MONGODB_ADMINPASSWORD: example
ME_CONFIG_MONGODB_URL: "mongodb://root:example@mongodb:27017/"
depends_on:
- mongodb
# FastAPI backend (served by uvicorn in development)
server:
build:
context: ./server
dockerfile: docker/FastAPI/Dockerfile
volumes:
- ./server/src:/server/src
- ./server/test_data_base:/server/test_data_base
- ./server/static:/server/static
- ./server/media:/server/media
ports:
- "8000:8000"
depends_on:
- mongodb
# web server (acting as a reverse proxy in production)
nginx:
build: ./server/docker/nginx
volumes:
- ./server/static:/server/static
- ./server/media:/server/media
ports:
- "80:80"
depends_on:
- server
restart: on-failure
# ReactJS frontend (run with npm start in development)
client:
build:
context: ./client
dockerfile: docker/node/Dockerfile
volumes:
- ./client/public:/app/public
- ./client/src:/app/src
environment:
NODE_ENV: development
CHOKIDAR_USEPOLLING: "true"
command: ["npm", "start"]
ports:
- "3000:3000"