forked from iammaze/flask-sqlalchemy-mysql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
75 lines (72 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
# Author: Mazhar Ahmed, CTO, Oceanize Inc
# All rights reserved. Copyright (c) Oceanize Inc
version: '3'
services:
app:
image: oceanize/flask_app:latest
container_name: flask_app
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: flask
DB_USER: flask
DB_PASSWORD: slimdingo85
volumes:
- ./app:/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"
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
- 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