-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose.yml
58 lines (54 loc) · 1.31 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
version: '2.1'
services:
dbengine:
image: mysql
container_name: dbengine
command: mysqld --user=root --default-authentication-plugin=mysql_native_password
volumes:
- .:/source
ports:
- "3306:3306"
networks:
- devops_net
restart: always
environment:
MYSQL_DATABASE: "devops"
MYSQL_PASSWORD: $MYSQL_PWD
MYSQL_ROOT_PASSWORD: $MYSQL_PWD
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
healthcheck:
test: mysql -u root -preleaseit! -e 'show databases'
interval: 5s
timeout: 60s
retries: 30
devopsapp:
depends_on:
dbengine:
condition: service_healthy
build:
context: .
dockerfile: django-container.yml
restart: always
container_name: devopsapp
ports:
- "8000:8000"
volumes:
- .:/home/DevOps
networks:
- devops_net
environment:
USE_MYSQL: "Yes"
ENGINE: "django.db.backends.mysql"
NAME: "devops"
USER: "root"
PASSWORD: $DJANGO_PWD
HOST: "dbengine"
PORT: "3306"
command: >
sh -c "python manage.py makemigrations &&
python manage.py migrate &&
python manage.py loaddata /home/DevOps/datadump.json &&
python manage.py runserver 0.0.0.0:8000"
networks:
devops_net:
driver: bridge