-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocker-compose.yml
87 lines (82 loc) · 1.72 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
version: '3'
services:
#Flask App Container
flask:
build:
context: app
dockerfile: Dockerfile
container_name: flask
image: faizanbashir/flask-python:3.6
restart: unless-stopped
tty: true
environment:
APP_ENV: "dev"
APP_DEBUG: "True"
APP_PORT: 5000
MONGODB_DATABASE: flaskdb
MONGODB_USERNAME: flaskuser
MONGODB_PASSWORD: f19skp9ssw0rd
MONGODB_HOSTNAME: mongodb
volumes:
- appdata:/var/www
depends_on:
- mongodb
networks:
- frontend
- backend
#MongoDB database container
mongodb:
image: mongo:4.0.8
container_name: mongodb
restart: unless-stopped
command: mongod --auth
environment:
MONGO_INITDB_ROOT_USERNAME: mongodbuser
MONGO_INITDB_ROOT_PASSWORD: cl3v3rP9ssw0rd
MONGO_INITDB_DATABASE: flaskdb
MONGODB_DATABASE: flaskdb
MONGODB_USER: flaskuser
MONGODB_PASS: f19skp9ssw0rd
MONGODB_DATA_DIR: /data/db
MONDODB_LOG_DIR: /dev/null
volumes:
- mongodbdata:/data/db
networks:
- backend
#Nginx Service
webserver:
build:
context: nginx
dockerfile: Dockerfile
image: faizanbashir/webserver:latest
container_name: webserver
restart: unless-stopped
tty: true
environment:
APP_ENV: "dev"
APP_NAME: "webserver"
APP_DEBUG: "true"
SERVICE_NAME: "webserver"
ports:
- "80:80"
- "443:443"
volumes:
- nginxdata:/etc/nginx
depends_on:
- flask
networks:
- frontend
#Docker Networks
networks:
frontend:
driver: bridge
backend:
driver: bridge
#Volumes
volumes:
mongodbdata:
driver: local
appdata:
driver: local
nginxdata:
driver: local