-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
70 lines (65 loc) · 1.42 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
59
60
61
62
63
64
65
66
67
68
69
70
version: '3.3'
networks:
mynet:
services:
db:
image: mysql:latest
volumes:
- mysql-data:/var/lib/mysql
container_name: db
networks:
- mynet
environment:
- MYSQL_DATABASE=db_server
- MYSQL_ROOT_HOST=%
- MYSQL_ROOT_PASSWORD=1234
ports:
- 3307:3306
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
healthcheck:
test: ['CMD-SHELL', 'mysqladmin ping -h 127.0.0.1 -u root --password=$$MYSQL_ROOT_PASSWORD']
interval: 10s
timeout: 2s
retries: 100
restart: always
springapp:
image: springapp
container_name: springapp
depends_on:
db:
condition: service_healthy
networks:
- mynet
ports:
- 8080:8080
build:
context: ./Spring boot/demo/
dockerfile: Dockerfile
restart: always
environment:
SPRING_DATASOURCE_URL: jdbc:mysql://db:3306/${MYSQL_DB}
SPRING_DATASOURCE_USERNAME: root
SPRING_DATASOURCE_PASSWORD: 1234
djangoapp:
image: djangoapp
container_name: djangoapp
depends_on:
db:
condition: service_healthy
networks:
- mynet
ports:
- 80:80
build:
context: ./Django/mySite/
dockerfile: Dockerfile
restart: always
environment:
MYSQL_HOST: db
MYSQL_USER: root
MYSQL_PASSWORD: 1234
MYSQL_DB: ${MYSQL_DB}
volumes:
mysql-data: