Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
executable file
·85 lines (82 loc) · 2.17 KB
/
Copy pathdocker-compose.yml
File metadata and controls
executable file
·85 lines (82 loc) · 2.17 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
version: "3.7"
networks:
db:
name: ${PROJECT_NAME}-network-db
# this is a YAML anchor to avoid repetition
# Any top-level key starting with x- in a Docker Compose file will be ignored
# replica with <<: *logging
x-logging: &logging
logging:
driver: json-file
services:
mariadb:
container_name: ${PROJECT_NAME}-mariadb
hostname: mariadb
build:
context: ./
dockerfile: tools/docker/mariadb/build.Dockerfile
args:
- MARIA_VERSION=${MARIA_VERSION}
- DOCKER_ENV=${DOCKER_ENV}
- TZ=${TZ}
mem_limit: 250m
restart: always
<<: *logging
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
TZ: ${TZ}
expose:
- 3306
networks:
- db
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 20s
timeout: 10s
retries: 7
php:
container_name: ${PROJECT_NAME}-php
hostname: php
extra_hosts: # https://stackoverflow.com/a/43541681/2046442
- "host.docker.internal:host-gateway"
build:
context: ./
dockerfile: ./tools/docker/php-fpm/build.Dockerfile
args:
- PHP_VERSION=${PHP_VERSION}
- DOCKER_ENV=${DOCKER_ENV}
- APP_DIRECTORY=${APP_DIRECTORY}
- HOST_UID=${HOST_UID}
- HOST_GID=${HOST_GID}
- INSTALL_PHP_XDEBUG=${INSTALL_PHP_XDEBUG}
restart: always
<<: *logging
environment:
- TZ=${TZ}
- APP_DIRECTORY=${APP_DIRECTORY}
- DOCKER_ENV=${DOCKER_ENV}
- CI=${CI:-false}
- MARIA_VERSION=${MARIA_VERSION}
- VIRTUAL_HOST=${VIRTUAL_HOST}
- PHP_IDE_CONFIG=${PHP_IDE_CONFIG}
- XDEBUG_CONFIG=${XDEBUG_CONFIG}
- XDEBUG_MODE=${XDEBUG_MODE}
- COMPOSER_ALLOW_SUPERUSER=${COMPOSER_ALLOW_SUPERUSER}
volumes:
- ${PWD}:${MOUNT_APP_DIRECTORY}
expose:
- "9000" # php-fpm
- "9003" # xdebug
depends_on:
mariadb:
condition: service_healthy
healthcheck:
test: ["CMD", "php-fpm", "-t"]
interval: 20s
timeout: 10s
retries: 7
networks:
db: