-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
40 lines (39 loc) · 966 Bytes
/
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
version: '3.8'
services:
order-api-server:
container_name: order-api-server
build:
context: .
dockerfile: Dockerfile
image: order-api-server:latest
env_file:
- .env
ports:
- "8082:8082"
environment:
SPRING_DATASOURCE_URL: ${DATASOURCE_URL}
SPRING_DATASOURCE_USERNAME: ${DATASOURCE_USER}
SPRING_DATASOURCE_PASSWORD: ${DATASOURCE_PASSWORD}
SERVER_PORT: 8082
depends_on:
order-db:
condition: service_healthy
order-db:
image: mysql:latest
container_name: order-db
restart: always
env_file:
- .env
environment:
MYSQL_DATABASE: ${MYSQLDB_NAME}
MYSQL_ROOT_PASSWORD: ${MYSQLDB_PASSWORD}
MYSQL_PASSWORD: ${MYSQLDB_PASSWORD}
MYSQL_TCP_PORT: 3307
volumes:
- /db:/var/lib/mysql
ports:
- "3307:3307"
healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
timeout: 20s
retries: 10