-
-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
37 lines (36 loc) · 1.13 KB
/
Copy pathdocker-compose.yml
File metadata and controls
37 lines (36 loc) · 1.13 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
services:
app:
build:
context: .
dockerfile: resources/docker/Dockerfile
args:
PHP_VERSION: ${PHP_VERSION:-8.4}
PHALCON_VARIANT: ${PHALCON_VARIANT:-v5}
UID: ${UID:-1000}
GID: ${GID:-1000}
container_name: ${PROJECT_PREFIX:-tutorial}-app
hostname: ${PROJECT_PREFIX:-tutorial}-app
ports:
- "${APP_PORT:-8080}:8080"
volumes:
- .:/srv
# Preserve the image's vendor/ (installed at build) from being shadowed by the bind mount
- /srv/vendor
env_file: .env
depends_on:
mysql:
condition: service_healthy
mysql:
image: mysql:8.0
container_name: ${PROJECT_PREFIX:-tutorial}-mysql
environment:
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD:-secret}
MYSQL_DATABASE: ${DB_NAME:-tutorial}
volumes:
- ./resources/schemas/tutorial.sql:/docker-entrypoint-initdb.d/tutorial.sql:ro
# No host port published: the app reaches the DB over the compose network as mysql:3306.
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-p${DB_PASSWORD:-secret}"]
interval: 5s
timeout: 5s
retries: 12