2018-05-20 13:02:29 +00:00
|
|
|
---
|
2024-01-06 14:19:36 +00:00
|
|
|
version: "3"
|
2018-06-17 08:20:21 +00:00
|
|
|
|
2024-01-06 14:19:36 +00:00
|
|
|
###############################################################
|
|
|
|
# Please see docker/README.md for usage information
|
|
|
|
###############################################################
|
2018-06-17 08:20:21 +00:00
|
|
|
|
2018-05-20 13:02:29 +00:00
|
|
|
services:
|
2024-01-06 16:43:48 +00:00
|
|
|
# HTTP/HTTPS proxy
|
|
|
|
#
|
2024-01-15 15:14:44 +00:00
|
|
|
# Sits in front of the *real* webserver and manages SSL and (optionally)
|
|
|
|
# load-balancing between multiple web servers
|
|
|
|
#
|
2024-01-15 19:56:35 +00:00
|
|
|
# You can disable this service by setting [DOCKER_PROXY_PROFILE="disabled"]
|
|
|
|
# in your [.env] file - the setting is near the bottom of the file.
|
|
|
|
#
|
|
|
|
# This also disables the [proxy-acme] service, if this is not desired, change the
|
|
|
|
# [DOCKER_PROXY_ACME_PROFILE] setting to an empty string [""]
|
|
|
|
#
|
2024-01-06 16:43:48 +00:00
|
|
|
# See: https://github.com/nginx-proxy/nginx-proxy/tree/main/docs
|
|
|
|
proxy:
|
|
|
|
image: nginxproxy/nginx-proxy:1.4
|
2024-01-17 17:51:37 +00:00
|
|
|
container_name: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-proxy"
|
2024-01-15 14:42:54 +00:00
|
|
|
restart: unless-stopped
|
2024-01-15 19:20:22 +00:00
|
|
|
profiles:
|
2024-01-15 19:56:35 +00:00
|
|
|
- ${DOCKER_PROXY_PROFILE:-}
|
2024-01-06 16:43:48 +00:00
|
|
|
volumes:
|
2024-01-17 17:51:37 +00:00
|
|
|
- "${DOCKER_PROXY_HOST_DOCKER_SOCKET_PATH}:/tmp/docker.sock:ro"
|
|
|
|
- "${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/proxy/conf.d:/etc/nginx/conf.d"
|
|
|
|
- "${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/proxy/vhost.d:/etc/nginx/vhost.d"
|
|
|
|
- "${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/proxy/certs:/etc/nginx/certs"
|
|
|
|
- "${DOCKER_ALL_HOST_DATA_ROOT_PATH}/proxy/html:/usr/share/nginx/html"
|
2024-01-06 16:43:48 +00:00
|
|
|
ports:
|
2024-01-17 17:51:37 +00:00
|
|
|
- "${DOCKER_PROXY_HOST_PORT_HTTP}:80"
|
|
|
|
- "${DOCKER_PROXY_HOST_PORT_HTTPS}:443"
|
2024-01-17 15:47:39 +00:00
|
|
|
healthcheck:
|
2024-01-17 16:30:40 +00:00
|
|
|
test: "curl --fail https://${APP_DOMAIN}/api/service/health-check"
|
2024-01-17 17:51:37 +00:00
|
|
|
interval: "${DOCKER_PROXY_HEALTHCHECK_INTERVAL}"
|
2024-01-17 15:47:39 +00:00
|
|
|
retries: 2
|
|
|
|
timeout: 5s
|
2024-01-06 16:43:48 +00:00
|
|
|
|
|
|
|
# Proxy companion for managing letsencrypt SSL certificates
|
|
|
|
#
|
2024-01-15 19:56:35 +00:00
|
|
|
# You can disable this service by setting [DOCKER_PROXY_ACME_PROFILE="disabled"]
|
|
|
|
# in your [.env] file - the setting is near the bottom of the file.
|
|
|
|
#
|
2024-01-06 16:43:48 +00:00
|
|
|
# See: https://github.com/nginx-proxy/acme-companion/tree/main/docs
|
|
|
|
proxy-acme:
|
|
|
|
image: nginxproxy/acme-companion
|
2024-01-17 17:51:37 +00:00
|
|
|
container_name: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-proxy-acme"
|
2024-01-15 14:42:54 +00:00
|
|
|
restart: unless-stopped
|
2024-01-15 19:20:22 +00:00
|
|
|
profiles:
|
2024-01-15 19:56:35 +00:00
|
|
|
- ${DOCKER_PROXY_ACME_PROFILE:-}
|
2024-01-06 16:43:48 +00:00
|
|
|
environment:
|
2024-01-06 18:01:48 +00:00
|
|
|
DEBUG: 0
|
2024-01-06 16:43:48 +00:00
|
|
|
DEFAULT_EMAIL: "${LETSENCRYPT_EMAIL}"
|
2024-01-17 17:51:37 +00:00
|
|
|
NGINX_PROXY_CONTAINER: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-proxy"
|
2024-01-06 16:43:48 +00:00
|
|
|
depends_on:
|
|
|
|
- proxy
|
|
|
|
volumes:
|
2024-01-17 17:51:37 +00:00
|
|
|
- "${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/proxy-acme:/etc/acme.sh"
|
|
|
|
- "${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/proxy/certs:/etc/nginx/certs"
|
|
|
|
- "${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/proxy/conf.d:/etc/nginx/conf.d"
|
|
|
|
- "${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/proxy/vhost.d:/etc/nginx/vhost.d"
|
|
|
|
- "${DOCKER_ALL_HOST_DATA_ROOT_PATH}/proxy/html:/usr/share/nginx/html"
|
|
|
|
- "${DOCKER_PROXY_HOST_DOCKER_SOCKET_PATH}:/var/run/docker.sock:ro"
|
2024-01-06 16:43:48 +00:00
|
|
|
|
2024-01-06 14:19:36 +00:00
|
|
|
web:
|
2024-01-17 17:51:37 +00:00
|
|
|
image: "${DOCKER_APP_IMAGE}:${DOCKER_APP_TAG}"
|
|
|
|
container_name: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-web"
|
2019-06-03 02:53:13 +00:00
|
|
|
restart: unless-stopped
|
2024-01-17 17:51:37 +00:00
|
|
|
profiles:
|
|
|
|
- ${DOCKER_WEB_PROFILE:-}
|
2024-01-06 18:01:48 +00:00
|
|
|
build:
|
2024-01-17 17:51:37 +00:00
|
|
|
target: ${DOCKER_APP_RUNTIME}-runtime
|
2024-01-15 23:50:16 +00:00
|
|
|
args:
|
2024-01-17 17:51:37 +00:00
|
|
|
PHP_VERSION: "${DOCKER_APP_PHP_VERSION}"
|
|
|
|
PHP_BASE_TYPE: "${DOCKER_APP_BASE_TYPE}"
|
|
|
|
PHP_DEBIAN_RELEASE: "${DOCKER_APP_DEBIAN_RELEASE}"
|
|
|
|
APT_PACKAGES_EXTRA: "${DOCKER_APP_APT_PACKAGES_EXTRA:-}"
|
|
|
|
PHP_PECL_EXTENSIONS_EXTRA: "${DOCKER_APP_PHP_PECL_EXTENSIONS_EXTRA:-}"
|
|
|
|
PHP_EXTENSIONS_EXTRA: "${DOCKER_APP_PHP_EXTENSIONS_EXTRA:-}"
|
2018-05-20 13:02:29 +00:00
|
|
|
volumes:
|
2024-01-06 14:19:36 +00:00
|
|
|
- "./.env:/var/www/.env"
|
2024-01-17 17:51:37 +00:00
|
|
|
- "${DOCKER_APP_HOST_CACHE_PATH}:/var/www/bootstrap/cache"
|
|
|
|
- "${DOCKER_APP_HOST_STORAGE_PATH}:/var/www/storage"
|
2024-01-06 16:43:48 +00:00
|
|
|
environment:
|
2024-01-06 18:01:48 +00:00
|
|
|
LETSENCRYPT_HOST: "${LETSENCRYPT_HOST}"
|
|
|
|
LETSENCRYPT_EMAIL: "${LETSENCRYPT_EMAIL}"
|
2024-01-15 23:50:16 +00:00
|
|
|
LETSENCRYPT_TEST: "${LETSENCRYPT_TEST:-}"
|
2024-01-06 18:01:48 +00:00
|
|
|
VIRTUAL_HOST: "${APP_DOMAIN}"
|
2024-01-06 16:43:48 +00:00
|
|
|
VIRTUAL_PORT: "80"
|
|
|
|
labels:
|
|
|
|
com.github.nginx-proxy.nginx-proxy.keepalive: 30
|
|
|
|
com.github.nginx-proxy.nginx-proxy.http2.enable: true
|
|
|
|
com.github.nginx-proxy.nginx-proxy.http3.enable: true
|
2024-01-15 19:39:59 +00:00
|
|
|
ports:
|
2024-01-17 17:51:37 +00:00
|
|
|
- "${DOCKER_WEB_PORT_EXTERNAL_HTTP}:80"
|
2020-04-11 15:48:02 +00:00
|
|
|
depends_on:
|
2020-04-11 15:52:05 +00:00
|
|
|
- db
|
2020-04-11 15:48:02 +00:00
|
|
|
- redis
|
2024-01-17 15:47:39 +00:00
|
|
|
healthcheck:
|
2024-01-17 16:30:40 +00:00
|
|
|
test: 'curl --header "Host: ${APP_DOMAIN}" --fail http://localhost/api/service/health-check'
|
2024-01-17 17:51:37 +00:00
|
|
|
interval: "${DOCKER_WEB_HEALTHCHECK_INTERVAL}"
|
2024-01-17 15:47:39 +00:00
|
|
|
retries: 2
|
|
|
|
timeout: 5s
|
2018-05-31 19:43:14 +00:00
|
|
|
|
2020-04-11 15:48:02 +00:00
|
|
|
worker:
|
2024-01-17 17:51:37 +00:00
|
|
|
image: "${DOCKER_APP_IMAGE}:${DOCKER_APP_TAG}"
|
|
|
|
container_name: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-worker"
|
2024-01-06 14:19:36 +00:00
|
|
|
command: gosu www-data php artisan horizon
|
2019-06-03 02:53:13 +00:00
|
|
|
restart: unless-stopped
|
2024-01-17 17:51:37 +00:00
|
|
|
profiles:
|
|
|
|
- ${DOCKER_WORKER_PROFILE:-}
|
2024-01-06 18:01:48 +00:00
|
|
|
build:
|
2024-01-17 17:51:37 +00:00
|
|
|
target: ${DOCKER_APP_RUNTIME}-runtime
|
2024-01-15 23:50:16 +00:00
|
|
|
args:
|
2024-01-17 17:51:37 +00:00
|
|
|
PHP_VERSION: "${DOCKER_APP_PHP_VERSION}"
|
|
|
|
PHP_BASE_TYPE: "${DOCKER_APP_BASE_TYPE}"
|
|
|
|
PHP_DEBIAN_RELEASE: "${DOCKER_APP_DEBIAN_RELEASE}"
|
|
|
|
APT_PACKAGES_EXTRA: "${DOCKER_APP_APT_PACKAGES_EXTRA:-}"
|
|
|
|
PHP_PECL_EXTENSIONS_EXTRA: "${DOCKER_APP_PHP_PECL_EXTENSIONS_EXTRA:-}"
|
|
|
|
PHP_EXTENSIONS_EXTRA: "${DOCKER_APP_PHP_EXTENSIONS_EXTRA:-}"
|
2019-04-22 02:40:32 +00:00
|
|
|
volumes:
|
2024-01-06 14:19:36 +00:00
|
|
|
- "./.env:/var/www/.env"
|
2024-01-17 17:51:37 +00:00
|
|
|
- "${DOCKER_APP_HOST_CACHE_PATH}:/var/www/bootstrap/cache"
|
|
|
|
- "${DOCKER_APP_HOST_STORAGE_PATH}:/var/www/storage"
|
2020-04-11 15:48:02 +00:00
|
|
|
depends_on:
|
2020-04-11 15:52:05 +00:00
|
|
|
- db
|
2020-04-11 15:48:02 +00:00
|
|
|
- redis
|
2024-01-17 15:47:39 +00:00
|
|
|
healthcheck:
|
|
|
|
test: gosu www-data php artisan horizon:status | grep running
|
2024-01-17 17:51:37 +00:00
|
|
|
interval: "${DOCKER_WORKER_HEALTHCHECK_INTERVAL}"
|
2024-01-17 15:47:39 +00:00
|
|
|
timeout: 5s
|
|
|
|
retries: 2
|
2020-04-11 15:48:02 +00:00
|
|
|
|
2018-06-17 08:20:21 +00:00
|
|
|
db:
|
2024-01-17 17:51:37 +00:00
|
|
|
image: mariadb:${DB_VERSION}
|
|
|
|
container_name: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-db"
|
2019-11-01 18:01:40 +00:00
|
|
|
command: --default-authentication-plugin=mysql_native_password
|
2024-01-06 14:19:36 +00:00
|
|
|
restart: unless-stopped
|
2024-01-17 17:51:37 +00:00
|
|
|
profiles:
|
|
|
|
- ${DOCKER_DB_PROFILE:-}
|
2024-01-06 18:01:48 +00:00
|
|
|
env_file:
|
|
|
|
- ".env"
|
2018-05-20 13:02:29 +00:00
|
|
|
volumes:
|
2024-01-17 17:51:37 +00:00
|
|
|
- "${DOCKER_DB_HOST_DATA_PATH}:/var/lib/mysql"
|
2024-01-06 14:19:36 +00:00
|
|
|
ports:
|
2024-01-17 17:51:37 +00:00
|
|
|
- "${DOCKER_DB_HOST_PORT}:3306"
|
2024-01-17 15:47:39 +00:00
|
|
|
healthcheck:
|
|
|
|
test:
|
|
|
|
[
|
|
|
|
"CMD",
|
|
|
|
"healthcheck.sh",
|
|
|
|
"--su-mysql",
|
|
|
|
"--connect",
|
|
|
|
"--innodb_initialized",
|
|
|
|
]
|
2024-01-17 17:51:37 +00:00
|
|
|
interval: "${DOCKER_DB_HEALTHCHECK_INTERVAL}"
|
2024-01-17 15:47:39 +00:00
|
|
|
retries: 2
|
|
|
|
timeout: 5s
|
2018-05-31 19:43:14 +00:00
|
|
|
|
2018-05-20 13:02:29 +00:00
|
|
|
redis:
|
2024-01-17 17:51:37 +00:00
|
|
|
image: redis:${DOCKER_REDIS_VERSION}
|
|
|
|
container_name: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-redis"
|
2019-06-03 02:53:13 +00:00
|
|
|
restart: unless-stopped
|
2024-01-17 14:41:48 +00:00
|
|
|
command: "${DOCKER_REDIS_CONFIG_FILE:-} --requirepass '${REDIS_PASSWORD:-}'"
|
2024-01-17 14:13:38 +00:00
|
|
|
environment:
|
|
|
|
- REDISCLI_AUTH=${REDIS_PASSWORD:-}
|
2024-01-06 18:01:48 +00:00
|
|
|
env_file:
|
|
|
|
- ".env"
|
2018-05-20 13:02:29 +00:00
|
|
|
volumes:
|
2024-01-17 17:51:37 +00:00
|
|
|
- "${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/redis:/etc/redis"
|
|
|
|
- "${DOCKER_REDIS_HOST_DATA_PATH}:/data"
|
2024-01-06 14:19:36 +00:00
|
|
|
ports:
|
2024-01-17 17:51:37 +00:00
|
|
|
- "${DOCKER_REDIS_HOST_PORT}:6379"
|
2024-01-06 14:19:36 +00:00
|
|
|
healthcheck:
|
2024-01-17 15:47:39 +00:00
|
|
|
test: ["CMD", "redis-cli", "-p", "6379", "ping"]
|
2024-01-17 17:51:37 +00:00
|
|
|
interval: "${DOCKER_REDIS_HEALTHCHECK_INTERVAL}"
|
2024-01-06 14:19:36 +00:00
|
|
|
retries: 2
|
2024-01-17 15:47:39 +00:00
|
|
|
timeout: 5s
|