-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
146 lines (130 loc) · 3.19 KB
/
docker-compose.yaml
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# version: "3.7"
# services:
# flask:
# container_name: flask-pebrassos
# build: .
# restart: always
# environment:
# - APP_NAME=MyFlaskApp
# - FLASK_APP="entrypoint"
# - FLASK_ENV="production"
# - APP_SETTINGS_MODULE=config.prod
# - MYSQL_USER= "admin"
# - MYSQL_PASSWORD= "1234
# - MYSQL_HOST= "localhost"
# - MYSQL_DATABASE= "Pebrassos"
# - MYSQL_PORT=3308
# - KEY_OWM='16247b8439d1a62601d38844971ccccc'
# expose:
# - 8081
# nginx:
# container_name: nginx-pebrassos
# build: ./nginx
# restart: always
# ports:
# - "8005:80"
# db:
# container_name: db-pebrassos
# image: mysql:5.7
# ports:
# - "32001:3308"
# environment:
# MYSQL_ROOT_PASSWORD: root
# volumes:
# - ./db:/docker-entrypoint-initdb.d/:ro
# Author: Mazhar Ahmed, CTO, Oceanize Inc
# All rights reserved. Copyright (c) Oceanize Inc
version: '3'
services:
flask:
expose:
- 8081
image: oceanize/flask_app:latest
container_name: flask_app1
restart: unless-stopped
labels:
project: "flask"
day: "9 Sep 2019"
build:
# build the image from Dockerfile
context: .
dockerfile: Dockerfile
environment:
# set database, memcached etc credentials
DB_HOST: mysql
DB_NAME: Pebrassos
DB_USER: flask
DB_PASSWORD: slimdingo85
APP_NAME: MyFlaskApp
FLASK_APP: entrypoint
FLASK_ENV: production
APP_SETTINGS_MODULE: config.prod
# MYSQL_USER: admin
# MYSQL_PASSWORD: 1234
# MYSQL_HOST: mysql
# MYSQL_DATABASE: Pebrassos
# MYSQL_PORT: 3306
MYSQL_USER: flask
MYSQL_PASSWORD: slimdingo85
MYSQL_HOST: mysql
MYSQL_DATABASE: flask
MYSQL_PORT: 3306
KEY_OWM: 16247b8439d1a62601d38844971ccccc
volumes:
- .:/app
links:
# network connection with these services
- mysql
depends_on:
# build those images first
- mysql
# ports:
# # bind on our 5000 port because most people have 80, 8080 already bound
# - "5000:5000"
nginx:
container_name: nginx-pebrassos
build: ./nginx
restart: always
ports:
- "8009:80"
mysql:
container_name: flask_mysql
# let's grab from mysql 5.7 image
image: mysql:5.7
volumes:
# pass volume named mysql-data to mysql container
- ./db:/docker-entrypoint-initdb.d/:ro
- mysql-data:/var/lib/mysql
restart: unless-stopped
labels:
project: "flask"
day: "9 Sep 2019"
ports:
- "3306:3306"
environment:
# credentials
MYSQL_ROOT_PASSWORD: slimdingo85
MYSQL_DATABASE: flask
MYSQL_USER: flask
MYSQL_PASSWORD: slimdingo85
phpmyadmin:
depends_on:
- mysql
image: phpmyadmin/phpmyadmin:latest
container_name: flask_phpmyadmin
restart: unless-stopped
labels:
project: "flask"
day: "9 Sep 2019"
ports:
- "5010:80"
environment:
PMA_HOST: mysql
PMA_USER: flask
PMA_PASSWORD: slimdingo85
MYSQL_ROOT_PASSWORD: slimdingo85
# volumes definition here
volumes:
# just a persistance data
mysql-data:
driver: local