-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
58 lines (50 loc) · 1.17 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
58
version: '3.8'
services:
mysql-8.1.0:
image: mysql:8.1.0
ports:
- "3307:3306"
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: true
command: >
mysqld
--log-bin=mysql-bin.log
--server-id 1
--binlog-format=row
--gtid_mode=on
--enforce-gtid-consistency=on
networks:
network:
ipv4_address: 172.0.0.2
hosp-info-sys:
build:
context: .
dockerfile: hospital_info_system.Dockerfile
args:
BASE_IMAGE: python:3.9.18-bookworm
command:
- /bin/sh
- -ce
- |
sleep 30
apt update
apt install -y jq
apt install -y default-mysql-client
mysql -h mysql-8.1.0 -u root --execute "create database hospital_info_system;"
cd hospital_info_system
python manage.py makemigrations hospital_info_applyer
python manage.py migrate
echo "now ready."
sleep infinity
ports:
- "8001:8000"
networks:
network:
ipv4_address: 172.0.0.3
networks:
network:
driver: bridge
ipam:
config:
- subnet: 172.0.0.0/24
gateway: 172.0.0.1