-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
39 lines (39 loc) · 1.12 KB
/
Copy pathdocker-compose.yml
File metadata and controls
39 lines (39 loc) · 1.12 KB
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
version: '3.8'
services:
app:
container_name: task-api
build:
dockerfile: Dockerfile
context: .
ports:
- "8100:8100"
depends_on:
db:
condition: service_healthy
environment:
MYSQL_USER: root
MYSQL_PASSWORD: ${MYSQL_ROOT_PASSWORD:-your_root_password}
# https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach
MYSQL_HOST: host.docker.internal
MYSQL_PORT: 3308
MYSQL_DATABASE: sample
SERVICE_PORT: 8100
db:
container_name: mysql
image: mysql:8.0.33
restart: always
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-your_root_password}
MYSQL_DATABASE: sample
# MYSQL_USER: dbuser
# MYSQL_PASSWORD: ${MYSQL_PASSWORD}:dbuser_password
# MYSQL_USER_HOST: '%'
# MYSQL_AUTH_PLUGIN: caching_sha2_password
ports:
# mysql -u dbuser -h localhost -P 3306 -p
- "3308:3306"
volumes:
# - ./mysql-data:/var/lib/mysql
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: "exit 0"