-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
40 lines (37 loc) · 1.07 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
version: '3.1'
services:
web:
build: .
command: sh -c 'bin/wait-for mysql:3306 -- python3 manage.py runserver 0.0.0.0:${APP_PORT}'
restart: unless-stopped
env_file: .env
volumes:
- .:/app
ports:
- ${PUBLIC_PORT}:${APP_PORT}
labels:
- "traefik.enable=true"
- "traefik.http.routers.djangoinit.rule=Host(`djangoinit.localhost`)"
- "traefik.http.routers.djangoinit.entrypoints=web"
- "traefik.http.services.djangoinit.loadbalancer.server.port=$$PUBLIC_PORT"
container_name: djangoinit
depends_on:
- mysql
mysql:
image: mariadb:10.5-focal
restart: unless-stopped
volumes:
- ./data/mysql/data/:/var/lib/mysql/:delegated
environment:
MYSQL_DATABASE: django
MYSQL_USER: django
MYSQL_PASSWORD: django-password
MYSQL_ALLOW_EMPTYPASSWORD: "false"
MYSQL_RANDOM_ROOT_PASSWORD: "true"
# MYSQL_ROOT_PASSWORD: root
healthcheck:
test: mysqladmin ping -h 127.0.0.1 -u $$MYSQL_USER --password=$$MYSQL_PASSWORD
networks:
default:
external:
name: web