-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
65 lines (60 loc) · 1.47 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
version: '3.7'
services:
flask-api:
image: flask_api_img
container_name: api
restart: unless-stopped
build:
context: api
tty: true
volumes:
- ~/docker_app/logs/api:/app/logs
- ./api/models:/app/models
environment:
APP_ENV: "prod"
APP_DEBUG: "False"
APP_PORT: 5000
MONGODB_DATABASE: mo
MONGODB_USERNAME: test
MONGODB_PASSWORD: test
MONGODB_HOSTNAME: mongodb
# Dont start flask until mongodb works
depends_on:
- mongodb
mongodb:
image: mongo:4.0.8
container_name: mongodb
restart: unless-stopped
command: mongod --auth
environment:
## Creating admin user with root access and later we use this to create db level authentication
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: mohan
MONGO_INITDB_DATABASE: admin
MONGODB_DATA_DIR: /data/db
MONDODB_LOG_DIR: /dev/null
volumes:
- ~/docker_app/mongodb:/data/db
nginx:
build: nginx
image: nginx_img
container_name: ai_nginx
restart: unless-stopped
# Dont start nginx server until flask-api up
depends_on:
- flask-api
tty: true
ports:
- '5000:80'
volumes:
- ~/docker_app/logs/nginx/:/var/log/nginx
web_app:
image: webapp_img
container_name: angular_app
restart: unless-stopped
build:
context: web
volumes:
- ~/docker_app/logs/webapp:/var/log/nginx
ports:
- '80:80'