-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
59 lines (54 loc) · 1.33 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
version: '3.8'
services:
mysql:
image: mysql:8.0
container_name: mysql
environment:
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
MYSQL_DATABASE: ${DB_NAME}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASSWORD}
ports:
- "3306:3306"
restart: always
healthcheck:
test: "mysql -uroot -p$DB_ROOT_PASSWORD -e 'select 1;'"
interval: 1s
retries: 20
volumes:
- mysql_data:/var/lib/mysql
redis:
image: redis:latest
container_name: redis
healthcheck:
test: "redis-cli ping"
interval: 1s
retries: 20
ports:
- "6379:6379"
springboot-app:
build:
context: .
dockerfile: Dockerfile
args:
PROFILE: ${PROFILE}
DB_NAME: ${DB_NAME}
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
container_name: concert-ticketing
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
ports:
- "8080:8080"
environment:
SPRING_PROFILES_ACTIVE: ${PROFILE}
SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/${DB_NAME}
SPRING_DATASOURCE_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
SPRING_DATASOURCE_USERNAME: ${DB_USER}
SPRING_DATASOURCE_PASSWORD: ${DB_PASSWORD}
SPRING_REDIS_HOST: ${SPRING_REDIS_HOST}
volumes:
mysql_data: