-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
72 lines (71 loc) · 2.05 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
version: "3.3"
services:
database:
image: mongo:4.0.8
volumes:
- data:/data/db
restart: unless-stopped
ports:
- '27017:27017'
fastapi: # backend
build:
context: ./backend
dockerfile: Dockerfile-dev
volumes:
- ./backend:/backend
# this is necessary to copy apiTypes.ts in frontend folder
- ./frontend/src/apis:/backend/app/frontend
environment:
PORT: 5000
MONGO_URL: 'mongodb://database:27017/'
# Environment variables used in app/server.py
GENERATE_FRONTEND_TYPES: 'true'
FOLDER_TO_SAVE_FRONTEND_TYPES: 'frontend'
# Environment variables for official FastAPI docker image
APP_MODULE: 'server:api'
LOG_LEVEL: 'debug'
DRAW_DB_DIAGRAM: 'true'
BACKEND_USER: 'admin'
BACKEND_PASSWORD: 'admin'
# start-reload.sh is a version of start.sh for development with live auto-reload
command: '/start-reload.sh'
ports:
- '5000:5000'
depends_on:
- database
react: # frontend
build:
context: ./frontend
dockerfile: Dockerfile-dev
ports:
- '9000:9000'
volumes:
- /usr/frontend/node_modules
- ./frontend/static:/frontend/static
- ./frontend/src:/frontend/src
- ./frontend/tsconfig.json:/frontend/tsconfig.json
- ./frontend/webpack.config.js:/frontend/webpack.config.js
environment:
BACKEND_URL: 'http://localhost:5000'
stdin_open: true # to replicate `-it` mode in docker run
tty: true # to replicate `-it` mode in docker run
depends_on:
- fastapi
react-storybook: # frontend
build:
context: ./frontend
dockerfile: Dockerfile-storybook
ports:
- '6006:6006'
restart: always
volumes:
- /usr/frontend/node_modules
- ./frontend/src:/frontend/src
- ./frontend/static:/frontend/static
- ./frontend/.storybook:/frontend/.storybook
- ./frontend/tsconfig.json:/frontend/tsconfig.json
- ./frontend/webpack.config.js:/frontend/webpack.config.js
depends_on:
- react
volumes:
data: