-
Notifications
You must be signed in to change notification settings - Fork 16
/
docker-compose.yml
45 lines (42 loc) · 1.02 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
version: '3.9'
services:
backend:
build: .
command: uvicorn src.main:app --reload --host 0.0.0.0 --port 8000
environment:
BASE_PATH_API: /api
SECRET_KEY: secretkey
ALLOWED_HOSTS: 127.0.0.1,localhost
MONGODB_NAME: blog-fastapi
MONGODB_URI: mongodb://mongodbuser:mongodbpassword@mongodb:27017
volumes:
- ./src/:/home/app/backend/src
env_file:
- ./.env
depends_on:
- mongodb
ports:
- "8000:8000"
frontend:
build: ./frontend
volumes:
- ./frontend:/home/app/frontend
- /home/app/frontend/node_modules
depends_on:
- backend
ports:
- "8080:8080"
mongodb:
image: mongo:4.0.8
restart: unless-stopped
command: mongod --auth
environment:
MONGO_INITDB_ROOT_USERNAME: mongodbuser
MONGO_INITDB_ROOT_PASSWORD: mongodbpassword
MONGO_INITDB_DATABASE: blog-fastapi
MONGODB_DATA_DIR: /data/db
MONDODB_LOG_DIR: /dev/null
volumes:
- mongodbdata:/data/db
volumes:
mongodbdata: