-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
43 lines (41 loc) · 1.2 KB
/
Copy pathdocker-compose.yml
File metadata and controls
43 lines (41 loc) · 1.2 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
40
41
42
43
services:
app:
build:
context: .
dockerfile: Dockerfile
environment:
APP_ENV: dev
APP_DEBUG: "1"
DATABASE_URL: mysql://app:app@database:3306/app?serverVersion=8.4&charset=utf8mb4
COMPOSER_ALLOW_SUPERUSER: "1"
depends_on:
database:
condition: service_healthy
ports:
- "8000:8000"
volumes:
- ./:/app
- vendor:/app/vendor
# Ajout du git config safe.directory avant le composer install
command: >
sh -c "git config --global --add safe.directory /app &&
composer install --no-interaction --no-progress --prefer-dist &&
php -S 0.0.0.0:8000 -t public"
database:
image: mysql:${MYSQL_VERSION:-8.4.9}
environment:
MYSQL_DATABASE: ${MYSQL_DATABASE:-app}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-app}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root}
MYSQL_USER: ${MYSQL_USER:-app}
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-u", "${MYSQL_USER:-app}", "-p${MYSQL_PASSWORD:-app}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
volumes:
- database_data:/var/lib/mysql:rw
volumes:
database_data:
vendor: