From 8761b89a9361b9dbaf0c823b8a5eb1cacae9a9ca Mon Sep 17 00:00:00 2001 From: Bryan Joshua Pedini Date: Wed, 4 Oct 2023 11:09:05 +0200 Subject: [PATCH] PHPMyAdmin Deployment --- .gitignore | 1 + docker-compose.yml | 41 +++++++++++++++++++++++++++++++++++++++++ example.env | 23 +++++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 .gitignore create mode 100644 docker-compose.yml create mode 100644 example.env diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..42c8f22 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,41 @@ +--- +services: + pma: + image: phpmyadmin:${PMA_VERSION} + restart: unless-stopped + environment: + - PMA_HOST=${PMA_HOST} + - PMA_USER=${PMA_USER} + - PMA_PASSWORD=${PMA_PASSWORD} + labels: + ### Section Træfik + - traefik.enable=${TRAEFIK_ENABLED} + - traefik.docker.network=${TRAEFIK_NETWORK} + ## HTTP + - traefik.http.routers.http-${TRAEFIK_ROUTER}.entrypoints=http + # redirect to HTTPS only + - traefik.http.routers.http-${TRAEFIK_ROUTER}.middlewares=${TRAEFIK_HTTP_MIDDLEWARES} + - traefik.http.routers.http-${TRAEFIK_ROUTER}.rule=${TRAEFIK_MATCHRULE} + ## HTTPS + - traefik.http.routers.https-${TRAEFIK_ROUTER}.entrypoints=https + # configure the exposed service + - traefik.http.routers.https-${TRAEFIK_ROUTER}.middlewares=${TRAEFIK_HTTPS_MIDDLEWARES} + - traefik.http.routers.https-${TRAEFIK_ROUTER}.rule=${TRAEFIK_MATCHRULE} + # enable TLS and its certificate provider + - traefik.http.routers.https-${TRAEFIK_ROUTER}.tls=${TRAEFIK_TLSENABLED} + - traefik.http.routers.https-${TRAEFIK_ROUTER}.tls.certresolver=${TRAEFIK_CERTRESOLVER} + # specify a service so a custom port can be used + - traefik.http.services.${TRAEFIK_SERVICE}.loadbalancer.server.port=${TRAEFIK_SERVICE_PORT} + ### Section Diun + - diun.enable=${DIUN_ENABLE} + - diun.watch_repo=${DIUN_WATCHREPO} + - diun.sort_tags=${DIUN_SORTALGO} + - diun.include_tags=${DIUN_INCLUDE} + - diun.exclude_tags=${DIUN_EXCLUDE} + networks: + - traefik + +networks: + traefik: + external: true + name: ${TRAEFIK_NETWORK} diff --git a/example.env b/example.env new file mode 100644 index 0000000..0905f21 --- /dev/null +++ b/example.env @@ -0,0 +1,23 @@ +# Træfik +TRAEFIK_ENABLED=true +TRAEFIK_NETWORK=traefik +TRAEFIK_ROUTER=phpmyadmin_example_com +TRAEFIK_SERVICE=phpmyadmin_example_com +TRAEFIK_SERVICE_PORT=80 +TRAEFIK_MATCHRULE=Host(`phpmyadmin.example.com`) +TRAEFIK_TLSENABLED=true +TRAEFIK_CERTRESOLVER=letsencrypt +TRAEFIK_HTTP_MIDDLEWARES=http-to-https +TRAEFIK_HTTPS_MIDDLEWARES=hsts + +# PHPMyAdmin +PMA_VERSION=5.2.1-apache +PMA_HOST=localhost +PMA_USER=root +PMA_PASSWORD=r00t +# Diun +DIUN_ENABLE=true +DIUN_WATCHREPO=true +DIUN_SORTALGO=semver +DIUN_INCLUDE= +DIUN_EXCLUDE=