Skip to content

Commit 592de93

Browse files
committed
Update docker-compose.common.yml
1 parent 05034ae commit 592de93

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

docker-compose.common.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ services:
33
image: tinybite-server:latest
44
container_name: tinybite-api
55
restart: always
6-
extra_hosts:
7-
- "host.docker.internal:host-gateway" # MySQL(호스트) 접근용
86
networks:
97
- tinybite-net
108
env_file:
119
- .env
1210
depends_on:
1311
redis:
1412
condition: service_healthy
13+
mysql:
14+
condition: service_healthy
1515

1616
nginx:
1717
container_name: nginx
@@ -29,6 +29,27 @@ services:
2929
depends_on:
3030
- tinybite-api
3131

32+
mysql:
33+
container_name: mysql
34+
image: mysql:8.0
35+
networks:
36+
- tinybite-net
37+
env_file:
38+
- .env
39+
environment:
40+
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
41+
MYSQL_DATABASE: ${MYSQL_DATABASE}
42+
MYSQL_USER: ${MYSQL_USER}
43+
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
44+
volumes:
45+
- mysql_data:/var/lib/mysql
46+
restart: always
47+
healthcheck:
48+
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_ROOT_PASSWORD}"]
49+
interval: 10s
50+
timeout: 5s
51+
retries: 5
52+
3253
redis:
3354
container_name: redis
3455
image: redis:7.2.4
@@ -56,6 +77,7 @@ services:
5677

5778
volumes:
5879
redis_data:
80+
mysql_data:
5981

6082
networks:
6183
tinybite-net:

0 commit comments

Comments
 (0)