-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
35 lines (33 loc) · 983 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
version: '3.4'
services:
web:
build: .
ports:
- "127.0.0.1:8000:80"
environment:
DATABASE_URL: mysql://user:password@database:3306/symfony?serverVersion=8&charset=utf8mb4
depends_on:
database:
condition: service_healthy
database:
image: mysql/mysql-server:8.0
healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost", "-uroot", "-prootpassword" ] # 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
# container_name: database
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:
- "3306:3306"
volumes:
db-data:
name: database