-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yaml
44 lines (40 loc) · 997 Bytes
/
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
version: '3.7'
services:
programmingbuddies-db:
image: mysql:8.0.20
restart: always
# You can change this but don't commit it
environment:
MYSQL_ROOT_PASSWORD: "secret-root"
MYSQL_PASSWORD: "secret"
MYSQL_USER: "PB"
MYSQL_DATABASE: "pbapi-db"
ports:
- 3306:3306
# Persistent database
volumes:
- db-data:/var/lib/mysql
command: --default-authentication-plugin=mysql_native_password
programmingbuddies-api:
restart: always
build: .
depends_on:
- programmingbuddies-db
ports:
- 5001:5001
env_file:
- .env
# Make sure this is consistent with the DB service environment
environment:
CONNECT: "mysql+mysqlconnector://PB:secret@programmingbuddies-db:3306/pbapi-db"
SERVER_HOST: "0.0.0.0"
SERVER_PORT: "5001"
volumes:
- .:/app
command: python src/runserver.py --reset-db
# Persistent database
networks:
default:
name: pb-net
volumes:
db-data: