Permalink
Fetching contributors…
Cannot retrieve contributors at this time
59 lines (54 sloc) 1.31 KB
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: "releaseit!"
MYSQL_ROOT_PASSWORD: "releaseit!"
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: "releaseit!"
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