2020-11-15 13:45:08 +00:00
|
|
|
---
|
|
|
|
version: "3.8"
|
|
|
|
|
|
|
|
services:
|
|
|
|
app:
|
2020-11-15 21:56:04 +00:00
|
|
|
image: benoitpodwinski/phpservermon
|
|
|
|
environment:
|
|
|
|
- PSM_BASE_URL=https://${DOMAIN}
|
|
|
|
- PSM_DB_HOST=db
|
|
|
|
- PSM_DB_NAME=phpservermonitor
|
|
|
|
- PSM_DB_USER=phpservermonitor
|
|
|
|
- PSM_DB_PASS_FILE=/run/secrets/db_password
|
|
|
|
- PSM_DB_PREFIX=psm_
|
|
|
|
- PSM_DEBUG
|
|
|
|
- PHP_TIMEZONE
|
|
|
|
- PSM_UPDATE_INTERVAL=15
|
|
|
|
- SMTP_HOST
|
|
|
|
- MAIL_FROM
|
2020-11-15 13:45:08 +00:00
|
|
|
networks:
|
2020-11-15 21:56:04 +00:00
|
|
|
- internal
|
2020-11-15 13:45:08 +00:00
|
|
|
- proxy
|
2020-11-15 21:56:04 +00:00
|
|
|
volumes:
|
|
|
|
- sessions:/sessions
|
|
|
|
depends_on:
|
|
|
|
- db
|
|
|
|
secrets:
|
|
|
|
- db_password
|
|
|
|
configs:
|
|
|
|
- source: msmtp_conf
|
|
|
|
target: /etc/msmtprc
|
|
|
|
- source: entrypoint_conf
|
|
|
|
target: /docker-entrypoint2.sh
|
|
|
|
mode: 0555
|
|
|
|
entrypoint: /docker-entrypoint2.sh
|
2020-11-15 13:45:08 +00:00
|
|
|
deploy:
|
|
|
|
restart_policy:
|
|
|
|
condition: on-failure
|
|
|
|
labels:
|
|
|
|
- "traefik.enable=true"
|
2020-11-15 21:56:04 +00:00
|
|
|
- "traefik.docker.network=proxy"
|
2020-11-15 13:45:08 +00:00
|
|
|
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80"
|
|
|
|
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
|
|
|
|
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
|
|
|
- "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}"
|
2020-11-15 21:56:04 +00:00
|
|
|
|
|
|
|
db:
|
|
|
|
image: mariadb
|
|
|
|
networks:
|
|
|
|
- internal
|
|
|
|
environment:
|
|
|
|
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db_root_password
|
|
|
|
- MYSQL_USER=phpservermonitor
|
|
|
|
- MYSQL_PASSWORD_FILE=/run/secrets/db_password
|
|
|
|
- MYSQL_DATABASE=phpservermonitor
|
|
|
|
secrets:
|
|
|
|
- db_password
|
|
|
|
- db_root_password
|
|
|
|
volumes:
|
|
|
|
- "mariadb:/var/lib/mysql"
|
2020-11-15 13:45:08 +00:00
|
|
|
|
|
|
|
networks:
|
|
|
|
proxy:
|
|
|
|
external: true
|
2020-11-15 21:56:04 +00:00
|
|
|
internal:
|
|
|
|
|
|
|
|
secrets:
|
|
|
|
db_root_password:
|
|
|
|
name: ${STACK_NAME}_db_root_password_${SECRET_DB_ROOT_PASSWORD_VERSION}
|
|
|
|
external: true
|
|
|
|
db_password:
|
|
|
|
name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION}
|
|
|
|
external: true
|
|
|
|
|
|
|
|
configs:
|
|
|
|
msmtp_conf:
|
|
|
|
name: ${STACK_NAME}_msmtp_conf_${MSMTP_CONF_VERSION}
|
|
|
|
file: msmtp.conf.tmpl
|
|
|
|
template_driver: golang
|
|
|
|
entrypoint_conf:
|
|
|
|
name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_CONF_VERSION}
|
|
|
|
file: entrypoint.sh.tmpl
|
|
|
|
template_driver: golang
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
sessions:
|
|
|
|
mariadb:
|