generated from coop-cloud/example
Initial working config
This commit is contained in:
parent
5fc53cf7f1
commit
f34b122f0a
|
@ -4,3 +4,17 @@ export DOMAIN=phpservermon.example.com
|
||||||
## Domain aliases
|
## Domain aliases
|
||||||
#export EXTRA_DOMAINS=', `www.phpservermon.example.com`'
|
#export EXTRA_DOMAINS=', `www.phpservermon.example.com`'
|
||||||
export LETS_ENCRYPT_ENV=production
|
export LETS_ENCRYPT_ENV=production
|
||||||
|
|
||||||
|
# phpservermon settings
|
||||||
|
export PSM_DEBUG=
|
||||||
|
|
||||||
|
export SMTP_FROM=status.example.com
|
||||||
|
#export SMTP_HOST=
|
||||||
|
|
||||||
|
export TIME_ZONE='Europe/Amsterdam'
|
||||||
|
|
||||||
|
export SECRET_DB_ROOT_PASSWORD_VERSION=v1
|
||||||
|
export SECRET_DB_PASSWORD_VERSION=v1
|
||||||
|
|
||||||
|
export ENTRYPOINT_CONF_VERSION=v1
|
||||||
|
export MSMTP_CONF_VERSION=v1
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
# Phpservermon
|
# phpservermon
|
||||||
|
|
||||||
|
https://github.com/bpodwinski/docker-phpservermon
|
||||||
|
|
||||||
Server monitor • https://github.com/phpservermon/phpservermon
|
Server monitor • https://github.com/phpservermon/phpservermon
|
||||||
|
|
||||||
|
|
73
compose.yml
73
compose.yml
|
@ -3,14 +3,41 @@ version: "3.8"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: nginx:1.19.2
|
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
|
||||||
networks:
|
networks:
|
||||||
|
- internal
|
||||||
- proxy
|
- proxy
|
||||||
|
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
|
||||||
deploy:
|
deploy:
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: on-failure
|
condition: on-failure
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
|
- "traefik.docker.network=proxy"
|
||||||
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80"
|
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80"
|
||||||
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
|
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
|
||||||
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
||||||
|
@ -19,13 +46,45 @@ services:
|
||||||
#- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
|
#- "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.SSLForceHost=true"
|
||||||
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
|
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "curl", "-f", "http://localhost"]
|
db:
|
||||||
interval: 30s
|
image: mariadb
|
||||||
timeout: 10s
|
networks:
|
||||||
retries: 10
|
- internal
|
||||||
start_period: 1m
|
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"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
proxy:
|
proxy:
|
||||||
external: true
|
external: true
|
||||||
|
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:
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
export PSM_DB_PASS=$(cat "$PSM_DB_PASS_FILE")
|
||||||
|
unset PSM_DB_PASS_FILE
|
||||||
|
|
||||||
|
apk add --no-cache msmtp
|
||||||
|
|
||||||
|
echo "sendmail_path = /usr/bin/msmtp -t -i" > /usr/local/etc/php/conf.d/sendmail.ini
|
||||||
|
|
||||||
|
if [ ! "${1-}" = "-e" ]; then
|
||||||
|
/docker-entrypoint.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
set +eu
|
|
@ -0,0 +1,3 @@
|
||||||
|
account default
|
||||||
|
host {{ env "SMTP_HOST" }}
|
||||||
|
from {{ env "MAIL_FROM" }}
|
Reference in New Issue