-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
38 lines (38 loc) · 859 Bytes
/
docker-compose.yml
File metadata and controls
38 lines (38 loc) · 859 Bytes
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
services:
db:
image: mysql:latest
restart: always
environment:
MYSQL_ROOT_PASSWORD: admin123
MYSQL_DATABASE: library_db
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
retries: 5
backend:
build:
context: .
image: ashishgurau/library_management_backend:latest
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
environment:
DB_ENGINE: django.db.backends.mysql
DB_NAME: library_db
DB_USER: root
DB_PASSWORD: admin123
DB_HOST: db
DB_PORT: 3306
volumes:
- .:/app
command: >
sh -c "python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000"
volumes:
mysql_data: