-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
42 lines (41 loc) · 1.06 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
version: "3.9"
services:
api:
build:
context: ./backend
dockerfile: Dockerfile
container_name: quiz_api
environment:
- PORT=${PORT}
- PYTHON_ENV=${PYTHON_ENV}
- APP_NAME=${APP_NAME}
- APP_VERSION=${APP_VERSION}
- MONGO_DB_URI=${MONGO_DB_URI}
- MONGO_DBNAME=${MONGO_DBNAME}
- SECRET_KEY=${SECRET_KEY}
- ALGORITHM=${ALGORITHM}
- ACCESS_TOKEN_EXPIRE_MINUTES=${ACCESS_TOKEN_EXPIRE_MINUTES}
- DEFAULT_ADMIN_NAME=${DEFAULT_ADMIN_NAME}
- DEFAULT_ADMIN_EMAIL=${DEFAULT_ADMIN_EMAIL}
- DEFAULT_ADMIN_PASSWORD=${DEFAULT_ADMIN_PASSWORD}
env_file:
- ./backend/.env
ports:
- ${PORT}:${PORT}
command: uvicorn app.main:app --host 0.0.0.0 --port ${PORT} --workers 4
restart: on-failure
depends_on:
- mongodb
mongodb:
image: mongo
container_name: mongo_db
command: mongod --quiet --logpath /dev/null
env_file:
- ./backend/.env
ports:
- "27017:27017"
restart: on-failure
volumes:
- mongo-db:/data/db
volumes:
mongo-db: