custom-php/compose.yml

103 lines
3.0 KiB
YAML
Raw Normal View History

version: "3.8"
services:
2021-07-14 10:38:58 +00:00
backend:
image: adhocore/phpfpm:8.0
volumes:
2021-07-14 10:38:58 +00:00
- "site_content:/var/www/html/"
networks:
- backend
- proxy
environment:
2021-07-14 10:38:58 +00:00
- DB_HOST=db
- DB_USER=site
- DB_PASSWORD_FILE=/run/secrets/db_password
- DB_NAME=site
- PHP_EXTENSIONS_TO_DISABLE
secrets:
- db_password
2020-10-23 02:06:26 +00:00
configs:
- source: php_uploads_conf
target: /usr/local/etc/php/conf.d/uploads.ini
- source: entrypoint_conf
target: /docker-entrypoint.sh
mode: 0555
entrypoint: /docker-entrypoint.sh
depends_on:
- db
deploy:
update_config:
failure_action: rollback
order: start-first
2021-07-14 10:38:58 +00:00
labels:
- coop-cloud.${STACK_NAME}.backend.version=8.0-92fac7ac
frontend:
image: nginx:1.19.2
networks:
- proxy
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.19.2-c628b67d
volumes:
- site_content:/var/www/html/
configs:
- source: nginx_default_conf
target: /etc/nginx/conf.d/default.conf
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost"]
interval: 30s
timeout: 10s
retries: 10
start_period: 1m
2020-10-02 07:11:40 +00:00
db:
2021-04-30 07:02:49 +00:00
image: "mariadb:10.6"
volumes:
- "mariadb:/var/lib/mysql"
networks:
- backend
environment:
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db_root_password
2021-07-14 10:38:58 +00:00
- MYSQL_DATABASE=site
- MYSQL_USER=site
- MYSQL_PASSWORD_FILE=/run/secrets/db_password
secrets:
- db_password
- db_root_password
2021-03-16 08:37:42 +00:00
deploy:
2021-05-03 07:50:15 +00:00
labels: ['coop-cloud.${STACK_NAME}.db.version=10.6-718cb856']
networks:
backend:
proxy:
external: true
volumes:
mariadb:
2021-07-14 10:38:58 +00:00
site_content:
secrets:
2020-09-18 07:56:39 +00:00
db_root_password:
external: true
2020-12-14 09:55:48 +00:00
name: ${STACK_NAME}_db_root_password_${SECRET_DB_ROOT_PASSWORD_VERSION}
2020-09-18 07:56:39 +00:00
db_password:
external: true
2020-12-14 09:55:48 +00:00
name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION}
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}
file: default.conf
2020-10-23 02:06:26 +00:00
php_uploads_conf:
name: ${STACK_NAME}_php_uploads_conf_${PHP_UPLOADS_CONF_VERSION}
file: uploads.ini