custom-php/compose.yml

79 lines
2.3 KiB
YAML
Raw Normal View History

version: "3.8"
services:
2021-07-14 11:28:31 +00:00
app:
image: php:${PHP_VERSION}-fpm-alpine3.13
volumes:
2021-07-14 10:38:58 +00:00
- "site_content:/var/www/html/"
networks:
- backend
- proxy
environment:
- PHP_EXTENSIONS
- APP_ENV
2020-10-23 02:06:26 +00:00
configs:
- source: php_uploads_conf
target: /usr/local/etc/php/conf.d/uploads.ini
2021-09-07 04:53:11 +00:00
- source: entrypoint_conf
target: /docker-entrypoint.sh
mode: 0555
entrypoint: /docker-entrypoint.sh
deploy:
update_config:
failure_action: rollback
order: start-first
2021-07-14 10:38:58 +00:00
labels:
- coop-cloud.${STACK_NAME}.app.version=${PHP_VERSION}-92fac7ac
2021-07-14 10:38:58 +00:00
frontend:
image: nginx:1.20-alpine
2021-07-14 10:38:58 +00:00
networks:
- proxy
2021-07-14 11:04:48 +00:00
depends_on:
2021-07-14 11:28:31 +00:00
- app
2021-07-14 10:38:58 +00:00
deploy:
restart_policy:
condition: on-failure
labels:
- "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80"
2020-10-05 11:06:51 +00:00
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
2021-07-14 10:38:58 +00:00
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
# Redirect from EXTRA_DOMAINS to DOMAIN
- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
- coop-cloud.${STACK_NAME}.frontend.version=1.20-c628b67d
2021-07-14 10:38:58 +00:00
volumes:
- site_content:/var/www/html/
configs:
- source: nginx_default_conf
target: /etc/nginx/conf.d/default.conf
2021-07-14 17:50:18 +00:00
environment:
- STACK_NAME
- ROOT_PATH
2021-07-14 11:04:48 +00:00
# healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost"]
# interval: 30s
# timeout: 10s
# retries: 10
# start_period: 1m
networks:
backend:
# internal: true
proxy:
external: true
volumes:
2021-07-14 10:38:58 +00:00
site_content:
2020-10-23 02:06:26 +00:00
configs:
entrypoint_conf:
name: ${STACK_NAME}_entrypoint_conf_${ENTRYPOINT_CONF_VERSION}
file: entrypoint.sh.tmpl
template_driver: golang
2021-07-14 10:38:58 +00:00
nginx_default_conf:
name: ${STACK_NAME}_nginx_default_conf_${NGINX_DEFAULT_CONF_VERSION}
2021-07-14 11:28:31 +00:00
file: nginx.conf
2021-07-14 17:50:18 +00:00
template_driver: golang
2020-10-23 02:06:26 +00:00
php_uploads_conf:
name: ${STACK_NAME}_php_uploads_conf_${PHP_UPLOADS_CONF_VERSION}
file: uploads.ini