diff --git a/.gitignore b/.gitignore index bb3a39a4..0dfbf9a8 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ /node_modules /site /src +/compose.override.yaml diff --git a/compose-config/build.yaml b/compose-config/build.yaml new file mode 100644 index 00000000..f3ddc731 --- /dev/null +++ b/compose-config/build.yaml @@ -0,0 +1,25 @@ +--- +# Enable [docker compose build] for building local version of Pixelfed + +services: + web: + build: &build + dockerfile: docker/Dockerfile + context: ../ + target: ${DOCKER_APP_RUNTIME}-runtime + cache_from: + - "type=registry,ref=${DOCKER_APP_IMAGE}:${DOCKER_APP_TAG}" + args: + APT_PACKAGES_EXTRA: "${DOCKER_APP_APT_PACKAGES_EXTRA:-}" + BUILD_FRONTEND: "${DOCKER_APP_BUILD_FRONTEND:-0}" + PHP_BASE_TYPE: "${DOCKER_APP_BASE_TYPE}" + PHP_DEBIAN_RELEASE: "${DOCKER_APP_DEBIAN_RELEASE}" + PHP_EXTENSIONS_EXTRA: "${DOCKER_APP_PHP_EXTENSIONS_EXTRA:-}" + PHP_PECL_EXTENSIONS_EXTRA: "${DOCKER_APP_PHP_PECL_EXTENSIONS_EXTRA:-}" + PHP_VERSION: "${DOCKER_APP_PHP_VERSION:?error}" + + worker: + build: *build + + cron: + build: *build diff --git a/compose-config/db/expose.yaml b/compose-config/db/expose.yaml new file mode 100644 index 00000000..96ad8e71 --- /dev/null +++ b/compose-config/db/expose.yaml @@ -0,0 +1,4 @@ +services: + db: + ports: + - "${DOCKER_DB_HOST_PORT:?error}:${DOCKER_DB_CONTAINER_PORT:?error}" diff --git a/compose-config/db/service.yaml b/compose-config/db/service.yaml new file mode 100644 index 00000000..f758500c --- /dev/null +++ b/compose-config/db/service.yaml @@ -0,0 +1,54 @@ +services: + db: + image: ${DOCKER_DB_IMAGE:?error} + container_name: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-db" + command: ${DOCKER_DB_COMMAND:-} + restart: unless-stopped + profiles: + - ${DOCKER_DB_PROFILE:-} + environment: + TZ: "${TZ:?error}" + # MySQL (Oracle) - "Environment Variables" at https://hub.docker.com/_/mysql + MYSQL_ROOT_PASSWORD: "${DOCKER_DB_ROOT_PASSWORD:?error}" + MYSQL_USER: "${DB_USERNAME:?error}" + MYSQL_PASSWORD: "${DB_PASSWORD:?error}" + MYSQL_DATABASE: "${DB_DATABASE:?error}" + # MySQL (MariaDB) - "Start a mariadb server instance with user, password and database" at https://hub.docker.com/_/mariadb + MARIADB_ROOT_PASSWORD: "${DOCKER_DB_ROOT_PASSWORD:?error}" + MARIADB_USER: "${DB_USERNAME:?error}" + MARIADB_PASSWORD: "${DB_PASSWORD:?error}" + MARIADB_DATABASE: "${DB_DATABASE:?error}" + # PostgreSQL - "Environment Variables" at https://hub.docker.com/_/postgres + POSTGRES_USER: "${DB_USERNAME:?error}" + POSTGRES_PASSWORD: "${DB_PASSWORD:?error}" + POSTGRES_DB: "${DB_DATABASE:?error}" + volumes: + - "../../${DOCKER_DB_HOST_DATA_PATH:?error}:${DOCKER_DB_CONTAINER_DATA_PATH:?error}" + healthcheck: + test: + [ + "CMD", + "healthcheck.sh", + "--su-mysql", + "--connect", + "--innodb_initialized", + ] + interval: "${DOCKER_DB_HEALTHCHECK_INTERVAL:?error}" + retries: 2 + timeout: 5s + + cron: + # https://docs.docker.com/reference/compose-file/services/#depends_on + depends_on: + db: + condition: "service_healthy" + + worker: + depends_on: + db: + condition: "service_healthy" + + web: + depends_on: + db: + condition: "service_healthy" diff --git a/compose-config/proxy/acme.yaml b/compose-config/proxy/acme.yaml new file mode 100644 index 00000000..d8911350 --- /dev/null +++ b/compose-config/proxy/acme.yaml @@ -0,0 +1,28 @@ +# Proxy companion for managing LetsEncrypt SSL certificates +# +# 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. +# +# See: https://github.com/nginx-proxy/acme-companion/tree/main/docs + +services: + proxy-acme: + image: nginxproxy/acme-companion:2.5 + container_name: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-proxy-acme" + restart: unless-stopped + profiles: + - ${DOCKER_PROXY_ACME_PROFILE:-} + environment: + DEBUG: 0 + DEFAULT_EMAIL: "${DOCKER_PROXY_LETSENCRYPT_EMAIL:?error}" + NGINX_PROXY_CONTAINER: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-proxy" + depends_on: + proxy: + condition: "service_healthy" + volumes: + - "${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" diff --git a/compose-config/proxy/service.yaml b/compose-config/proxy/service.yaml new file mode 100644 index 00000000..08f508da --- /dev/null +++ b/compose-config/proxy/service.yaml @@ -0,0 +1,52 @@ +# HTTP/HTTPS proxy +# +# Sits in front of the *real* webserver and manages SSL and (optionally) +# load-balancing between multiple web servers +# +# 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 [""] +# +# See: https://github.com/nginx-proxy/nginx-proxy/tree/main/docs + +services: + proxy: + image: nginxproxy/nginx-proxy:1.6 + container_name: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-proxy" + restart: unless-stopped + profiles: + - ${DOCKER_PROXY_PROFILE:-} + environment: + DOCKER_SERVICE_NAME: "proxy" + volumes: + - "../../${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" + ports: + - "${DOCKER_PROXY_HOST_PORT_HTTP}:80" + - "${DOCKER_PROXY_HOST_PORT_HTTPS}:443" + healthcheck: + test: "curl --fail https://${APP_DOMAIN}/api/service/health-check" + interval: "${DOCKER_PROXY_HEALTHCHECK_INTERVAL}" + retries: 2 + timeout: 5s + + web: + volumes: + - "../../${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/proxy/conf.d:/shared/proxy/conf.d" + + environment: + LETSENCRYPT_HOST: "${DOCKER_PROXY_LETSENCRYPT_HOST:?error}" + LETSENCRYPT_EMAIL: "${DOCKER_PROXY_LETSENCRYPT_EMAIL:?error}" + LETSENCRYPT_TEST: "${DOCKER_PROXY_LETSENCRYPT_TEST:-}" + VIRTUAL_HOST: "${APP_DOMAIN}" + 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 diff --git a/compose-config/redis/expose.yaml b/compose-config/redis/expose.yaml new file mode 100644 index 00000000..54c01bcc --- /dev/null +++ b/compose-config/redis/expose.yaml @@ -0,0 +1,4 @@ +services: + redis: + ports: + - "${DOCKER_REDIS_HOST_PORT}:6379" diff --git a/compose-config/redis/service.yaml b/compose-config/redis/service.yaml new file mode 100644 index 00000000..909fab68 --- /dev/null +++ b/compose-config/redis/service.yaml @@ -0,0 +1,34 @@ +services: + redis: + image: redis:${DOCKER_REDIS_VERSION} + container_name: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-redis" + restart: unless-stopped + command: "${DOCKER_REDIS_CONFIG_FILE:-} --requirepass '${REDIS_PASSWORD:-}'" + profiles: + - ${DOCKER_REDIS_PROFILE:-} + environment: + TZ: "${TZ:?error}" + REDISCLI_AUTH: ${REDIS_PASSWORD:-} + volumes: + - "../../${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/redis:/etc/redis" + - "../../${DOCKER_REDIS_HOST_DATA_PATH}:/data" + healthcheck: + test: ["CMD", "redis-cli", "-p", "6379", "ping"] + interval: "${DOCKER_REDIS_HEALTHCHECK_INTERVAL:?error}" + retries: 2 + timeout: 5s + + cron: + depends_on: + redis: + condition: "service_healthy" + + worker: + depends_on: + redis: + condition: "service_healthy" + + web: + depends_on: + redis: + condition: "service_healthy" diff --git a/compose-config/web/expose.yaml b/compose-config/web/expose.yaml new file mode 100644 index 00000000..9071a35e --- /dev/null +++ b/compose-config/web/expose.yaml @@ -0,0 +1,4 @@ +services: + web: + ports: + - "${DOCKER_WEB_PORT_EXTERNAL_HTTP}:80" diff --git a/compose.override.yaml.example b/compose.override.yaml.example new file mode 100644 index 00000000..c44bf6d7 --- /dev/null +++ b/compose.override.yaml.example @@ -0,0 +1,26 @@ +--- +include: + - path: + # Uncomment to add support for [docker compose build] for local images. + # - compose-config/build.yaml + + # Uncomment to add nginx proxy in front of the [web] container. + # - compose-config/proxy/service.yaml + + # Uncomment to add nginx acme (LetsEncrypt) support to [proxy] container. + # - compose-config/proxy/acme.yaml + + # Uncomment to expose [web] container to the host directly. + # - compose-config/web/expose.yaml + + # Comment to disable the included [redis] service. + - compose-config/redis/service.yaml + + # Uncomment to expose the [redis] server to the host directly. + # - compose-config/redis/expose.yaml + + # Comment to disable the included [db] service. + - compose-config/db/service.yaml + + # Uncomment to expose the [db] server to the host directly. + # - compose-config/db/expose.yaml diff --git a/compose.yaml b/compose.yaml index 05bf3a99..af727245 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,115 +1,21 @@ --- -############################################################### -# Please see docker/README.md for usage information -############################################################### - services: - # HTTP/HTTPS proxy - # - # Sits in front of the *real* webserver and manages SSL and (optionally) - # load-balancing between multiple web servers - # - # 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 [""] - # - # See: https://github.com/nginx-proxy/nginx-proxy/tree/main/docs - proxy: - image: nginxproxy/nginx-proxy:1.6 - container_name: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-proxy" - restart: unless-stopped - profiles: - - ${DOCKER_PROXY_PROFILE:-} - environment: - DOCKER_SERVICE_NAME: "proxy" - volumes: - - "${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" - ports: - - "${DOCKER_PROXY_HOST_PORT_HTTP}:80" - - "${DOCKER_PROXY_HOST_PORT_HTTPS}:443" - healthcheck: - test: "curl --fail https://${APP_DOMAIN}/api/service/health-check" - interval: "${DOCKER_PROXY_HEALTHCHECK_INTERVAL}" - retries: 2 - timeout: 5s - - # Proxy companion for managing letsencrypt SSL certificates - # - # 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. - # - # See: https://github.com/nginx-proxy/acme-companion/tree/main/docs - proxy-acme: - image: nginxproxy/acme-companion:2.5 - container_name: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-proxy-acme" - restart: unless-stopped - profiles: - - ${DOCKER_PROXY_ACME_PROFILE:-} - environment: - DEBUG: 0 - DEFAULT_EMAIL: "${DOCKER_PROXY_LETSENCRYPT_EMAIL:?error}" - NGINX_PROXY_CONTAINER: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-proxy" - depends_on: - - proxy - volumes: - - "${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" - web: image: "${DOCKER_APP_IMAGE}:${DOCKER_APP_TAG}" container_name: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-web" restart: unless-stopped profiles: - ${DOCKER_WEB_PROFILE:-} - build: - dockerfile: docker/Dockerfile - target: ${DOCKER_APP_RUNTIME}-runtime - cache_from: - - "type=registry,ref=${DOCKER_APP_IMAGE}:${DOCKER_APP_TAG}" - args: - APT_PACKAGES_EXTRA: "${DOCKER_APP_APT_PACKAGES_EXTRA:-}" - BUILD_FRONTEND: "${DOCKER_APP_BUILD_FRONTEND:-0}" - PHP_BASE_TYPE: "${DOCKER_APP_BASE_TYPE}" - PHP_DEBIAN_RELEASE: "${DOCKER_APP_DEBIAN_RELEASE}" - PHP_EXTENSIONS_EXTRA: "${DOCKER_APP_PHP_EXTENSIONS_EXTRA:-}" - PHP_PECL_EXTENSIONS_EXTRA: "${DOCKER_APP_PHP_PECL_EXTENSIONS_EXTRA:-}" - PHP_VERSION: "${DOCKER_APP_PHP_VERSION:?error}" environment: # Used by Pixelfed Docker init script DOCKER_SERVICE_NAME: "web" DOCKER_APP_ENTRYPOINT_DEBUG: ${DOCKER_APP_ENTRYPOINT_DEBUG:-0} ENTRYPOINT_SKIP_SCRIPTS: ${ENTRYPOINT_SKIP_SCRIPTS:-} - # Used by [proxy] service - LETSENCRYPT_HOST: "${DOCKER_PROXY_LETSENCRYPT_HOST:?error}" - LETSENCRYPT_EMAIL: "${DOCKER_PROXY_LETSENCRYPT_EMAIL:?error}" - LETSENCRYPT_TEST: "${DOCKER_PROXY_LETSENCRYPT_TEST:-}" - VIRTUAL_HOST: "${APP_DOMAIN}" - VIRTUAL_PORT: "80" volumes: - "./.env:/var/www/.env" - - "${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/proxy/conf.d:/shared/proxy/conf.d" - "${DOCKER_APP_HOST_CACHE_PATH}:/var/www/bootstrap/cache" - "${DOCKER_APP_HOST_OVERRIDES_PATH}:/docker/overrides:ro" - "${DOCKER_APP_HOST_STORAGE_PATH}:/var/www/storage" - 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 - ports: - - "${DOCKER_WEB_PORT_EXTERNAL_HTTP}:80" - depends_on: - - db - - redis healthcheck: test: 'curl --header "Host: ${APP_DOMAIN}" --fail http://localhost/api/service/health-check' interval: "${DOCKER_WEB_HEALTHCHECK_INTERVAL}" @@ -124,19 +30,6 @@ services: stop_signal: SIGTERM profiles: - ${DOCKER_WORKER_PROFILE:-} - build: - dockerfile: docker/Dockerfile - target: ${DOCKER_APP_RUNTIME}-runtime - cache_from: - - "type=registry,ref=${DOCKER_APP_IMAGE}:${DOCKER_APP_TAG}" - args: - APT_PACKAGES_EXTRA: "${DOCKER_APP_APT_PACKAGES_EXTRA:-}" - BUILD_FRONTEND: "${DOCKER_APP_BUILD_FRONTEND:-0}" - PHP_BASE_TYPE: "${DOCKER_APP_BASE_TYPE}" - PHP_DEBIAN_RELEASE: "${DOCKER_APP_DEBIAN_RELEASE}" - PHP_EXTENSIONS_EXTRA: "${DOCKER_APP_PHP_EXTENSIONS_EXTRA:-}" - PHP_PECL_EXTENSIONS_EXTRA: "${DOCKER_APP_PHP_PECL_EXTENSIONS_EXTRA:-}" - PHP_VERSION: "${DOCKER_APP_PHP_VERSION:?error}" environment: # Used by Pixelfed Docker init script DOCKER_SERVICE_NAME: "worker" @@ -144,13 +37,9 @@ services: ENTRYPOINT_SKIP_SCRIPTS: ${ENTRYPOINT_SKIP_SCRIPTS:-} volumes: - "./.env:/var/www/.env" - - "${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/proxy/conf.d:/shared/proxy/conf.d" - "${DOCKER_APP_HOST_CACHE_PATH}:/var/www/bootstrap/cache" - "${DOCKER_APP_HOST_OVERRIDES_PATH}:/docker/overrides:ro" - "${DOCKER_APP_HOST_STORAGE_PATH}:/var/www/storage" - depends_on: - - db - - redis healthcheck: test: gosu www-data php artisan horizon:status | grep running interval: "${DOCKER_WORKER_HEALTHCHECK_INTERVAL:?error}" @@ -165,19 +54,6 @@ services: stop_signal: SIGTERM profiles: - ${DOCKER_CRON_PROFILE:-} - build: - dockerfile: docker/Dockerfile - target: ${DOCKER_APP_RUNTIME}-runtime - cache_from: - - "type=registry,ref=${DOCKER_APP_IMAGE}:${DOCKER_APP_TAG}" - args: - APT_PACKAGES_EXTRA: "${DOCKER_APP_APT_PACKAGES_EXTRA:-}" - BUILD_FRONTEND: "${DOCKER_APP_BUILD_FRONTEND:-0}" - PHP_BASE_TYPE: "${DOCKER_APP_BASE_TYPE}" - PHP_DEBIAN_RELEASE: "${DOCKER_APP_DEBIAN_RELEASE}" - PHP_EXTENSIONS_EXTRA: "${DOCKER_APP_PHP_EXTENSIONS_EXTRA:-}" - PHP_PECL_EXTENSIONS_EXTRA: "${DOCKER_APP_PHP_PECL_EXTENSIONS_EXTRA:-}" - PHP_VERSION: "${DOCKER_APP_PHP_VERSION:?error}" environment: # Used by Pixelfed Docker init script DOCKER_SERVICE_NAME: "cron" @@ -185,71 +61,6 @@ services: ENTRYPOINT_SKIP_SCRIPTS: ${ENTRYPOINT_SKIP_SCRIPTS:-} volumes: - "./.env:/var/www/.env" - - "${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/proxy/conf.d:/shared/proxy/conf.d" - "${DOCKER_APP_HOST_CACHE_PATH}:/var/www/bootstrap/cache" - "${DOCKER_APP_HOST_OVERRIDES_PATH}:/docker/overrides:ro" - "${DOCKER_APP_HOST_STORAGE_PATH}:/var/www/storage" - depends_on: - - db - - redis - - db: - image: ${DOCKER_DB_IMAGE:?error} - container_name: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-db" - command: ${DOCKER_DB_COMMAND:-} - restart: unless-stopped - profiles: - - ${DOCKER_DB_PROFILE:-} - environment: - TZ: "${TZ:?error}" - # MySQL (Oracle) - "Environment Variables" at https://hub.docker.com/_/mysql - MYSQL_ROOT_PASSWORD: "${DOCKER_DB_ROOT_PASSWORD:?error}" - MYSQL_USER: "${DB_USERNAME:?error}" - MYSQL_PASSWORD: "${DB_PASSWORD:?error}" - MYSQL_DATABASE: "${DB_DATABASE:?error}" - # MySQL (MariaDB) - "Start a mariadb server instance with user, password and database" at https://hub.docker.com/_/mariadb - MARIADB_ROOT_PASSWORD: "${DOCKER_DB_ROOT_PASSWORD:?error}" - MARIADB_USER: "${DB_USERNAME:?error}" - MARIADB_PASSWORD: "${DB_PASSWORD:?error}" - MARIADB_DATABASE: "${DB_DATABASE:?error}" - # PostgreSQL - "Environment Variables" at https://hub.docker.com/_/postgres - POSTGRES_USER: "${DB_USERNAME:?error}" - POSTGRES_PASSWORD: "${DB_PASSWORD:?error}" - POSTGRES_DB: "${DB_DATABASE:?error}" - volumes: - - "${DOCKER_DB_HOST_DATA_PATH:?error}:${DOCKER_DB_CONTAINER_DATA_PATH:?error}" - ports: - - "${DOCKER_DB_HOST_PORT:?error}:${DOCKER_DB_CONTAINER_PORT:?error}" - healthcheck: - test: - [ - "CMD", - "healthcheck.sh", - "--su-mysql", - "--connect", - "--innodb_initialized", - ] - interval: "${DOCKER_DB_HEALTHCHECK_INTERVAL:?error}" - retries: 2 - timeout: 5s - - redis: - image: redis:${DOCKER_REDIS_VERSION} - container_name: "${DOCKER_ALL_CONTAINER_NAME_PREFIX}-redis" - restart: unless-stopped - command: "${DOCKER_REDIS_CONFIG_FILE:-} --requirepass '${REDIS_PASSWORD:-}'" - profiles: - - ${DOCKER_REDIS_PROFILE:-} - environment: - TZ: "${TZ:?error}" - REDISCLI_AUTH: ${REDIS_PASSWORD:-} - volumes: - - "${DOCKER_ALL_HOST_CONFIG_ROOT_PATH}/redis:/etc/redis" - - "${DOCKER_REDIS_HOST_DATA_PATH}:/data" - ports: - - "${DOCKER_REDIS_HOST_PORT}:6379" - healthcheck: - test: ["CMD", "redis-cli", "-p", "6379", "ping"] - interval: "${DOCKER_REDIS_HEALTHCHECK_INTERVAL:?error}" - retries: 2 - timeout: 5s