Proxy avec Caddy

This commit is contained in:
2025-10-13 15:21:35 +02:00
parent 543fb85772
commit 451516d5bf
2 changed files with 41 additions and 22 deletions

View File

@@ -33,6 +33,8 @@ psql -h 127.0.0.1 -d sql -U sql -c "\copy (select id, source, target, cost, reve
- https://www.kaggle.com/datasets/alexandrelemercier/food-detailed-nutritional-content
### Proxy
### Administration
pgAdmin est un outil dadministration et de gestion pour PostgreSQL.

View File

@@ -1,5 +1,10 @@
services:
# ----------------------------------------------------------------------
# Proxy
#
# ----------------------------------------------------------------------
# Caddy
# Web server, load balancer, and reverse proxy
# https://caddyserver.com/
@@ -14,12 +19,12 @@ services:
networks:
- caddy_net
environment:
CADDY_INGRESS_NETWORKS: caddy_net
CADDY_INGRESS_NETWORKS: ${COMPOSE_PROJECT_NAME}_caddy_net
volumes:
- ./data:/usr/share/caddy
- /var/run/docker.sock:/var/run/docker.sock:ro
labels:
caddy_admin: "off"
caddy_admin: "on"
whoami:
image: traefik/whoami
@@ -96,20 +101,22 @@ services:
SUPERSET_CONFIG_PATH: /app/pythonpath/superset_config.py
SUPERSET_SECRET_KEY: ${SUPERSET_SECRET:-YOUR_OWN_RANDOM_GENERATED_SECRET_KEY}
SUPERSET_LOAD_EXAMPLES: no
ports:
- "8088:8088"
volumes:
- superset_home:/app/superset_home
- ./superset_config.py:/app/pythonpath/superset_config.py:Z
networks:
- caddy_net
command: >
sh -c "
superset db upgrade &&
superset fab create-admin --username admin --firstname Admin --lastname User --email admin@superset.com --password admin &&
superset init &&
superset run -h 0.0.0.0 -p 8088 --with-threads --reload --debugger
superset run -h 0.0.0.0 -p 80 --with-threads --reload --debugger
"
networks:
- caddy_net
labels:
caddy: superset.localhost
caddy.reverse_proxy: "{{upstreams 80}}"
caddy.tls: internal
profiles:
- bi
@@ -120,10 +127,6 @@ services:
condition: service_healthy
volumes:
- /dev/urandom:/dev/random:ro
ports:
- "3000:3000"
networks:
- caddy_net
environment:
MB_DB_TYPE: postgres
MB_DB_HOST: ${MB_DB_HOST:-database}
@@ -141,6 +144,12 @@ services:
MB_EMAIL_SMTP_HOST: mailpit
MB_EMAIL_SMTP_PORT: 1025
MB_EMAIL_FROM_ADDRESS: metabase@univ-lorraine.fr
networks:
- caddy_net
labels:
caddy: superset.localhost
caddy.reverse_proxy: "{{upstreams 80}}"
caddy.tls: internal
profiles:
- bi
@@ -279,27 +288,25 @@ services:
database:
condition: service_healthy
command: postgrest
ports:
- 3005:3005
networks:
- caddy_net
environment:
PGRST_DB_URI: postgres://${POSTGREST_USER:-postgrest}:9012@${POSTGREST_HOST:-database}:${POSTGREST_DB_PORT:-5432}/${COMPOSE_PROJECT_NAME}
PGRST_DB_SCHEMAS: ${POSTGREST_DB_SCHEMAS:-public}
PGRST_DB_ANON_ROLE: ${POSTGREST_DB_ANON_ROLE:-role_web}
PGRST_JWT_SECRET: ${POSTGREST_JWT_SECRET:-ChangeMeChangeMeChangeMeChangeMe}
PGRST_ADMIN_SERVER_PORT: 3055
PGRST_SERVER_PORT: 3005
PGRST_SERVER_PORT: 80
networks:
- caddy_net
labels:
caddy: postgrest.localhost
caddy.reverse_proxy: "{{upstreams 80}}"
caddy.tls: internal
profiles:
- api
scalar:
image: scalarapi/api-reference:0.4.2
ports:
- "8080:8080"
restart: "no"
networks:
- caddy_net
environment:
API_REFERENCE_CONFIG: |
{
@@ -308,6 +315,12 @@ services:
],
"theme": "purple"
}
networks:
- caddy_net
labels:
caddy: scalar.localhost
caddy.reverse_proxy: "{{upstreams 8080}}"
caddy.tls: internal
profiles:
- api
@@ -336,8 +349,6 @@ services:
target: /etc/grafana/dashboards
volumes:
- grafana:/var/lib/grafana
ports:
- 3000:3000
environment:
#GF_SECURITY_ADMIN_EMAIL: ${ADMIN_EMAIL}
#GF_SECURITY_ADMIN_PASSWORD: ${ADMIN_PASSWORD}
@@ -348,6 +359,12 @@ services:
GF_USERS_ALLOW_SIGN_UP: false
GF_FEATURE_TOGGLES_ENABLE: traceQLStreaming metricsSummary lokiFormatQuery alertmanagerRemoteOnly
GF_INSTALL_PLUGINS: yesoreyeram-infinity-datasource
networks:
- caddy_net
labels:
caddy: grafana.localhost
caddy.reverse_proxy: "{{upstreams 3000}}"
caddy.tls: internal
profiles:
- telemetry