-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
52 lines (50 loc) · 1.23 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
version: "3.4"
services:
web:
build: .
volumes:
- .:/var/www
- ./docker-entry.sh:/etc/entrypoint.sh
entrypoint: ["sh", "/etc/entrypoint.sh"]
ports:
- "3310:3310"
environment:
APP_PORT: 3310
APP_SECRET: 123456789
DB_HOST: database
DB_PORT: 3306
DB_USER: user
DB_PASSWORD: password
DB_NAME: js_template_fullstack
VITE_BACKEND_URL: ""
depends_on:
database:
condition: service_healthy
database:
image: mysql/mysql-server:8.0
healthcheck:
test: [
"CMD",
"mysqladmin",
"ping",
"-h",
"localhost",
"-uuser",
"-ppassword",
] # Command to check health.
interval: 5s # Interval between health checks.
timeout: 5s # Timeout for each health checking.
retries: 20 # Hou many times retries.
start_period: 10s
volumes:
- ./database-setup.sh:/docker-entrypoint-initdb.d/setup.sh
# - db-data:/var/lib/mysql
environment:
MYSQL_USER: user
MYSQL_PASSWORD: password
# Password for root access
MYSQL_ROOT_PASSWORD: rootpassword
ports:
- target: 3306
published: 3306
protocol: tcp