forked from CEOS-Developers/spring-instagram-20th
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
48 lines (45 loc) · 1.03 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
version: "3"
services:
database:
container_name: instagram
image: mysql:8.0
platform: linux/amd64
environment:
MYSQL_DATABASE: instagram
MYSQL_ROOT_HOST: '%'
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
TZ: 'Asia/Seoul'
ports:
- "3306:3306"
command:
- "mysqld"
- "--character-set-server=utf8mb4"
- "--collation-server=utf8mb4_unicode_ci"
networks:
- network
healthcheck:
test: [ "CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -p${DB_PASSWORD} --silent" ]
interval: 30s
retries: 5
start_period: 10s
timeout: 10s
application:
container_name: main-server
build:
dockerfile: Dockerfile
ports:
- "8080:8080"
environment:
SPRING_DATASOURCE_URL: ${DB_URL}
SPRING_DATASOURCE_USERNAME: ${DB_USERNAME}
SPRING_DATASOURCE_PASSWORD: ${DB_PASSWORD}
depends_on:
database:
condition: service_healthy
networks:
- network
env_file:
- .env
networks:
network:
driver: bridge