From 1d301f86382607060101e6fce4ed6a4dbf9036ed Mon Sep 17 00:00:00 2001 From: "e.medina" Date: Mon, 13 Oct 2025 11:56:51 +0200 Subject: [PATCH] Caddy dynamique --- Caddyfile | 4 ++++ README.md | 6 ++++++ compose.yaml | 42 ++++++++++++++++++++++++++++++++++-------- 3 files changed, 44 insertions(+), 8 deletions(-) create mode 100644 Caddyfile diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 0000000..7f00cd1 --- /dev/null +++ b/Caddyfile @@ -0,0 +1,4 @@ +*.localhost { + reverse_proxy pgadmin:80 + tls internal +} diff --git a/README.md b/README.md index eedf806..3de5c90 100644 --- a/README.md +++ b/README.md @@ -31,3 +31,9 @@ psql -h 127.0.0.1 -d sql -U sql -c "\copy (select id, source, target, cost, reve ### Jeux de données - https://www.kaggle.com/datasets/alexandrelemercier/food-detailed-nutritional-content + + +### Administration + +pgAdmin est un outil d’administration et de gestion pour PostgreSQL. +C’est l’équivalent d’un « phpMyAdmin » pour MySQL, mais conçu pour PostgreSQL. diff --git a/compose.yaml b/compose.yaml index 3ef3f9b..0871cf0 100644 --- a/compose.yaml +++ b/compose.yaml @@ -4,13 +4,31 @@ services: # Web server, load balancer, and reverse proxy # https://caddyserver.com/ caddy: - image: caddy:2.10.2 + image: lucaslorentz/caddy-docker-proxy:2.10 restart: "no" ports: - - "8019:80" + - 80:80 + - 443:443/tcp + - 443:443/udp - "2019:2019" + networks: + - caddy_net + environment: + CADDY_INGRESS_NETWORKS: caddy_net volumes: - ./data:/usr/share/caddy + - /var/run/docker.sock:/var/run/docker.sock:ro + labels: + caddy_admin: "off" + + whoami: + image: traefik/whoami + networks: + - caddy_net + labels: + caddy: whoami.localhost + caddy.reverse_proxy: "{{upstreams 80}}" + caddy.tls: internal # ---------------------------------------------------------------------- # Base de données relationnelles @@ -51,12 +69,16 @@ services: target: /pgadmin4/servers.json volumes: - pgadmin:/var/lib/pgadmin/ - ports: - - "3009:80" environment: PGADMIN_DEFAULT_EMAIL: ${ADMIN_EMAIL} PGADMIN_DEFAULT_PASSWORD: ${ADMIN_PASSWORD} PGADMIN_DISABLE_POSTFIX: true + networks: + - caddy_net + labels: + caddy: pgadmin.localhost + caddy.reverse_proxy: "{{upstreams 80}}" + caddy.tls: internal profiles: - admin @@ -206,8 +228,7 @@ services: # https://www.graphile.org/postgraphile/ postgraphile: - build: - context: ./postgraphile + image: iut/postgraphile:2025-12 restart: "no" depends_on: database: @@ -232,8 +253,8 @@ services: - PGPASSWORD=${DB_PASSWORD} - PGDATABASE=${COMPOSE_PROJECT_NAME} profiles: - - api - - graph + - api2 + - graph2 # ---------------------------------------------------------------------- # Web API @@ -340,6 +361,7 @@ services: - telemetry volumes: + caddy_config: pgadmin: database_data: superset_home: @@ -355,3 +377,7 @@ volumes: configs: pgadmin_config: file: ./pgadmin-servers.json + +networks: + caddy_net: + driver: bridge