generated from WildCodeSchool/simple-mvc
-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.override.yml
37 lines (35 loc) · 1.1 KB
/
docker-compose.override.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
version: '3.4'
services:
web:
ports:
- "127.0.0.1:8000:80"
environment:
DB_USER: user
DB_PASSWORD: password
DB_HOST: database
DB_NAME: simplemvc
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