Files
sql/compose.yaml

471 lines
13 KiB
YAML
Raw Normal View History

2025-08-27 07:51:06 +02:00
services:
2025-10-13 11:12:42 +02:00
2025-10-13 15:21:35 +02:00
# ----------------------------------------------------------------------
2025-10-14 21:11:54 +02:00
# Proxy inverse
2025-10-13 15:21:35 +02:00
#
# ----------------------------------------------------------------------
2025-10-13 11:12:42 +02:00
# Caddy
# Web server, load balancer, and reverse proxy
# https://caddyserver.com/
caddy:
2025-10-13 11:56:51 +02:00
image: lucaslorentz/caddy-docker-proxy:2.10
2025-10-13 11:12:42 +02:00
restart: "no"
ports:
2025-10-14 07:31:52 +02:00
- "80:80"
- "443:443/tcp"
- "443:443/udp"
2025-10-13 11:56:51 +02:00
networks:
- caddy_net
environment:
2025-10-13 15:21:35 +02:00
CADDY_INGRESS_NETWORKS: ${COMPOSE_PROJECT_NAME}_caddy_net
2025-10-13 11:12:42 +02:00
volumes:
2025-10-14 09:06:39 +02:00
- caddy_config:/config
2025-10-15 23:33:08 +02:00
- ./caddy:/data
2025-10-14 07:31:52 +02:00
- /var/run/docker.sock:/var/run/docker.sock:ro
2025-10-15 07:30:31 +02:00
- ./data:/srv/www:ro
2025-10-14 09:06:39 +02:00
labels:
2025-10-15 23:33:08 +02:00
caddy: "localhost"
2025-10-14 09:06:39 +02:00
caddy.root: "* /srv/www"
2025-10-14 21:11:54 +02:00
caddy.file_server: "" # Active le serveur de fichiers statiques
caddy.tls: internal # HTTPS auto-signé géré par Caddy
2025-10-13 11:56:51 +02:00
2025-10-15 07:30:31 +02:00
# WhoAmI
# Tiny Go webserver that prints OS information and HTTP request to output.
# https://github.com/traefik/whoami
2025-10-13 11:56:51 +02:00
whoami:
image: traefik/whoami
2025-10-14 07:31:52 +02:00
depends_on:
- caddy
2025-10-13 11:56:51 +02:00
networks:
- caddy_net
labels:
caddy: whoami.localhost
caddy.reverse_proxy: "{{upstreams 80}}"
caddy.tls: internal
2025-10-13 11:12:42 +02:00
# ----------------------------------------------------------------------
# Base de données relationnelles
#
# ----------------------------------------------------------------------
2025-08-27 07:51:06 +02:00
database:
2025-10-06 19:26:02 +02:00
image: iut/pgsql:2025-12
2025-08-27 07:51:06 +02:00
environment:
POSTGRES_INITDB_ARGS: "--locale-provider=icu --icu-locale=fr-FR"
2025-10-13 07:49:20 +02:00
POSTGRES_PASSWORD: ${PG_PASSWORD:-!ChangeMe!}
2025-08-27 07:51:06 +02:00
POSTGRES_USER: ${COMPOSE_PROJECT_NAME}
volumes:
2025-10-06 19:26:02 +02:00
- database_data:/var/lib/postgresql:rw
2025-10-13 21:27:02 +02:00
- ./postgresql-entrypoint-initdb.d:/docker-entrypoint-initdb.d:Z
2025-10-06 22:08:23 +02:00
- ./data:/tmp:z
2025-08-27 08:41:54 +02:00
ports:
2025-10-12 18:20:29 +02:00
- "5432:5432"
2025-10-14 21:11:54 +02:00
networks:
- caddy_net
2025-09-16 15:51:03 +02:00
healthcheck:
test: ["CMD", "pg_isready", "--username", "${COMPOSE_PROJECT_NAME}", "--dbname", "${COMPOSE_PROJECT_NAME}"]
interval: 10s
timeout: 5s
retries: 5
2025-09-19 10:02:52 +02:00
start_period: 20s
2025-08-27 07:51:06 +02:00
2025-10-14 21:11:54 +02:00
# ----------------------------------------------------------------------
# Administration
#
# ----------------------------------------------------------------------
2025-10-12 18:20:29 +02:00
# pgAdmin
# Rich administration and development platform for PostgreSQL.
# https://www.pgadmin.org/
pgadmin:
2025-10-14 09:49:29 +02:00
image: dpage/pgadmin4:9.8
2025-10-12 18:20:29 +02:00
depends_on:
2025-10-13 11:06:48 +02:00
database:
2025-10-12 18:20:29 +02:00
condition: service_healthy
2025-10-14 21:11:54 +02:00
caddy:
condition: service_started
2025-10-12 18:20:29 +02:00
restart: "no"
configs:
- source: pgadmin_config
target: /pgadmin4/servers.json
volumes:
- pgadmin:/var/lib/pgadmin/
environment:
2025-10-14 09:06:39 +02:00
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_EMAIL}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_PASSWORD}
2025-10-12 18:20:29 +02:00
PGADMIN_DISABLE_POSTFIX: true
2025-10-13 11:56:51 +02:00
networks:
- caddy_net
labels:
caddy: pgadmin.localhost
caddy.reverse_proxy: "{{upstreams 80}}"
caddy.tls: internal
2025-10-12 18:20:29 +02:00
2025-10-13 11:06:48 +02:00
# ----------------------------------------------------------------------
# Documents
#
# ----------------------------------------------------------------------
2025-09-16 15:51:20 +02:00
# CouchDB
# Single-node document database
# https://couchdb.apache.org/
couchdb:
2025-10-14 09:06:39 +02:00
image: couchdb:3.5
2025-09-16 15:51:20 +02:00
volumes:
- couchdb_data:/opt/couchdb/data
environment:
2025-10-13 21:27:02 +02:00
COUCHDB_USER: ${COUCHDB_USER}
COUCHDB_PASSWORD: ${COUCHDB_PASSWORD}
2025-10-14 23:27:54 +02:00
ports:
- 5984:5984
networks:
- caddy_net
2025-10-14 21:11:54 +02:00
labels:
caddy: couchdb.localhost
caddy.reverse_proxy: "{{upstreams 5984}}"
caddy.tls: internal
2025-09-16 15:51:20 +02:00
2025-10-15 07:30:31 +02:00
couchdb-init:
build:
dockerfile: ./couchdb-init.Dockerfile
context: .
environment:
COUCHDB_USER: ${COUCHDB_USER}
COUCHDB_PASSWORD: ${COUCHDB_PASSWORD}
depends_on:
- couchdb
networks:
- caddy_net
2025-10-06 22:08:23 +02:00
# MongoDB
#
# https://www.mongodb.com/
2025-09-16 15:51:20 +02:00
mongodb:
2025-09-19 10:02:52 +02:00
image: mongodb/mongodb-community-server:8.0-ubi8
2025-09-16 15:51:20 +02:00
volumes:
- mongodb_configdb:/data/configdb
- mongodb_data:/data/db
2025-10-06 22:08:23 +02:00
- ./mongodb-entrypoint-initdb.d:/docker-entrypoint-initdb.d:Z
- ./data:/initdb.d:z
2025-09-16 15:51:20 +02:00
ports:
- "27017:27017"
environment:
2025-10-13 21:27:02 +02:00
MONGODB_INITDB_ROOT_USERNAME: ${MONGODB_USER}
MONGODB_INITDB_ROOT_PASSWORD: ${MONGODB_PASSWORD}
2025-09-16 15:51:20 +02:00
2025-09-19 10:02:52 +02:00
# Redis
# In-memory key-value database
# https://redis.io/fr/
redis:
image: redis:8.2
command:
- 'redis-server'
- '--save 60 1'
- '--loglevel verbose'
2025-10-13 21:27:02 +02:00
- '--requirepass ${REDIS_PASSWORD}'
2025-09-19 10:02:52 +02:00
ports:
- "6379:6379"
healthcheck:
2025-10-13 21:27:02 +02:00
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD}", "--raw", "incr", "ping" ]
2025-09-19 10:02:52 +02:00
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
volumes:
- redis_data:/data
# Neo4J
# Des graphes ultra-rapides, à léchelle du pétaoctet
# https://neo4j.com/
neo4j:
image: neo4j:5.26.12-community
ports:
- 7687:7687
volumes:
- neo4j_data:/data
- neo4j_logs:/logs
environment:
2025-10-14 10:39:02 +02:00
NEO4J_dbms_connector_https_enabled: "false"
2025-10-14 21:11:54 +02:00
NEO4J_AUTH: neo4j/${NEO4J_PASSWORD:-!ChangeMe!}
networks:
- caddy_net
labels:
caddy: neo4j.localhost
caddy.reverse_proxy: "{{upstreams 7474}}"
caddy.tls: internal
2025-09-19 10:02:52 +02:00
2025-10-13 07:49:20 +02:00
# PostGraphile
# Instant GraphQL API
# https://www.graphile.org/postgraphile/
postgraphile:
2025-10-13 11:56:51 +02:00
image: iut/postgraphile:2025-12
2025-10-13 07:49:20 +02:00
restart: "no"
depends_on:
database:
condition: service_healthy
command:
[
2025-10-14 22:28:15 +02:00
"--port", "80",
2025-10-13 07:49:20 +02:00
"--schema", "${POSTGRAPHILE_SCHEMA:-public}",
"--enhance-graphiql",
"--cors",
"--allow-explain",
"--dynamic-json",
"--append-plugins",
"postgraphile-plugin-connection-filter,postgraphile-plugin-fulltext-filter,@graphile/postgis,postgraphile-plugin-connection-filter-postgis"
]
2025-10-13 12:01:58 +02:00
networks:
- caddy_net
2025-10-13 07:49:20 +02:00
environment:
2025-10-14 22:28:15 +02:00
- PGHOST=database
- PGPORT=5432
- PGUSER=${POSTGRAPHILE_USER:-postgraphile_user}
2025-10-14 21:11:54 +02:00
- PGPASSWORD=${POSTGRAPHILE_PASSWORD:-9013}
2025-10-13 07:49:20 +02:00
- PGDATABASE=${COMPOSE_PROJECT_NAME}
2025-10-14 18:06:00 +02:00
labels:
caddy: postgraphile.localhost
2025-10-14 22:28:15 +02:00
caddy.reverse_proxy: "{{upstreams 80}}"
2025-10-14 18:06:00 +02:00
caddy.tls: internal
2025-10-14 21:11:54 +02:00
2025-10-12 18:20:29 +02:00
# ----------------------------------------------------------------------
# Web API
#
# ----------------------------------------------------------------------
# PostgREST
# Serve a fully RESTful API from any existing PostgreSQL database.
# It provides a cleaner, more standards-compliant, faster API than you are likely to write from scratch.
2025-10-13 21:27:02 +02:00
# https://docs.postgrest.org/en/v13/
2025-10-12 18:20:29 +02:00
postgrest:
2025-10-13 07:49:20 +02:00
image: postgrest/postgrest:v13.0.7
2025-10-12 18:20:29 +02:00
restart: "no"
depends_on:
database:
condition: service_healthy
2025-10-14 21:11:54 +02:00
caddy:
condition: service_started
2025-10-12 18:20:29 +02:00
command: postgrest
environment:
2025-10-13 20:59:17 +02:00
PGRST_DB_URI: postgres://${POSTGREST_USER:-postgrest}:${POSTGREST_PASSWORD}@${POSTGREST_HOST:-database}:${POSTGREST_DB_PORT:-5432}/${COMPOSE_PROJECT_NAME}
2025-10-12 18:20:29 +02:00
PGRST_DB_SCHEMAS: ${POSTGREST_DB_SCHEMAS:-public}
2025-10-14 21:11:54 +02:00
PGRST_DB_ANON_ROLE: ${POSTGREST_DB_ANON_ROLE:-anonyme}
2025-10-13 11:06:48 +02:00
PGRST_JWT_SECRET: ${POSTGREST_JWT_SECRET:-ChangeMeChangeMeChangeMeChangeMe}
2025-10-12 18:20:29 +02:00
PGRST_ADMIN_SERVER_PORT: 3055
2025-10-13 15:21:35 +02:00
PGRST_SERVER_PORT: 80
2025-10-14 22:28:15 +02:00
PGRST_OPENAPI_SERVER_PROXY_URI: https://postgrest.localhost
2025-10-13 15:21:35 +02:00
networks:
- caddy_net
labels:
caddy: postgrest.localhost
caddy.reverse_proxy: "{{upstreams 80}}"
caddy.tls: internal
2025-10-12 18:20:29 +02:00
2025-10-13 21:27:02 +02:00
# Scalar
# Create world-class API Docs with a built-in interactive playground
# which seamlessly turns to a full featured API Client
2025-10-13 07:49:20 +02:00
scalar:
image: scalarapi/api-reference:0.4.2
restart: "no"
environment:
API_REFERENCE_CONFIG: |
{
"sources":[
2025-10-14 21:11:54 +02:00
{ "url": "https://postgrest.localhost" }
2025-10-13 07:49:20 +02:00
],
"theme": "purple"
}
2025-10-13 15:21:35 +02:00
networks:
- caddy_net
labels:
caddy: scalar.localhost
caddy.reverse_proxy: "{{upstreams 8080}}"
caddy.tls: internal
2025-10-13 07:49:20 +02:00
2025-10-13 16:30:11 +02:00
# ----------------------------------------------------------------------
# Mock Web API
#
# ----------------------------------------------------------------------
smocker:
2025-10-13 16:35:40 +02:00
image: thiht/smocker:0.18.5
2025-10-13 16:30:11 +02:00
restart: "no"
networks:
- caddy_net
2025-10-14 18:06:00 +02:00
#labels:
# caddy.mock.localhost: "https://smocker.localhost"
# caddy.mock.localhost.handle_path./ui/*: "reverse_proxy {{upstreams 8081}}"
# caddy.mock.localhost.handle_path./api/*: "reverse_proxy {{upstreams 8080}}"
# caddy.mock.localhost.handle_path.: "redir /ui"
# caddy.mock.localhost.tls: internal
2025-10-13 16:30:11 +02:00
2025-10-13 16:35:40 +02:00
toxiproxy:
image: ghcr.io/shopify/toxiproxy
restart: "no"
2025-10-14 09:49:29 +02:00
# ----------------------------------------------------------------------
# Business Intelligence
#
# ----------------------------------------------------------------------
superset:
image: apache/superset:3.1.3
depends_on:
database:
condition: service_healthy
environment:
SUPERSET_CONFIG_PATH: /app/pythonpath/superset_config.py
SUPERSET_SECRET_KEY: ${SUPERSET_SECRET:-YOUR_OWN_RANDOM_GENERATED_SECRET_KEY}
SUPERSET_LOAD_EXAMPLES: no
volumes:
- superset_home:/app/superset_home
- ./superset_config.py:/app/pythonpath/superset_config.py:Z
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 80 --with-threads --reload --debugger
"
networks:
- caddy_net
labels:
caddy: superset.localhost
caddy.reverse_proxy: "{{upstreams 80}}"
caddy.tls: internal
metabase:
image: metabase/metabase:v0.56.5.5
depends_on:
database:
condition: service_healthy
volumes:
- /dev/urandom:/dev/random:ro
environment:
MB_DB_TYPE: postgres
MB_DB_HOST: ${MB_DB_HOST:-database}
MB_DB_PORT: 5432
MB_DB_USER: metabase_user
MB_DB_PASS: ${DB_ROOT_PASSWORD:-supermotdepasse}
MB_DB_DBNAME: metabase
MB_SITE_LOCALE: fr
MB_ADMIN_EMAIL: etudiant@univ-lorraine.fr
MB_ANON_TRACKING_ENABLED: false
MB_CHECK_FOR_UPDATES: false
MB_NO_SURVEYS: yes
MB_START_OF_WEEK: monday
MB_CUSTOM_FORMATTING: '{"type/Temporal":{"time_style":"HH:mm","date_style":"D MMMM, YYYY","date_abbreviate":true},"type/Currency":{"currency":"EUR"},"type/Number":{"number_separators":", "}}'
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
metabase-init:
build:
context: ./metabase
depends_on:
- metabase
2025-10-14 09:53:17 +02:00
rabbitmq:
2025-10-14 09:56:55 +02:00
image: rabbitmq:4.1.4-management
2025-10-14 09:53:17 +02:00
ports:
- "5672:5672" # AMQP
- "1883:1883" # MQTT
2025-10-14 10:39:02 +02:00
networks:
- caddy_net
2025-10-14 09:53:17 +02:00
environment:
RABBITMQ_DEFAULT_USER: admin
RABBITMQ_DEFAULT_PASS: admin
RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS: "-rabbitmq_mqtt tcp_listeners [1883]"
volumes:
- rabbitmq_data:/var/lib/rabbitmq
command: >
sh -c "rabbitmq-plugins enable --offline rabbitmq_mqtt rabbitmq_management &&
rabbitmq-server"
2025-10-14 10:39:02 +02:00
labels:
caddy: rabbitmq.localhost
caddy.reverse_proxy: "{{upstreams 15672}}"
caddy.tls: internal
2025-10-14 21:11:54 +02:00
2025-10-12 18:20:29 +02:00
# ----------------------------------------------------------------------
# Observabilité - Télémétrie
#
# ----------------------------------------------------------------------
# Grafana
# Open source analytics & monitoring solution for every database.
# https://grafana.com/
grafana:
2025-10-14 09:49:29 +02:00
image: grafana/grafana-oss:12.1.0
2025-10-12 18:20:29 +02:00
restart: no
deploy:
resources:
limits:
memory: 100M
configs:
2025-10-14 21:11:54 +02:00
- source: grafana_provisioning
target: /etc/grafana/provisioning
2025-10-12 18:20:29 +02:00
- source: grafana_dashboards
target: /etc/grafana/dashboards
volumes:
- grafana:/var/lib/grafana
2025-10-13 07:49:20 +02:00
environment:
2025-10-12 18:20:29 +02:00
#GF_SECURITY_ADMIN_EMAIL: ${ADMIN_EMAIL}
#GF_SECURITY_ADMIN_PASSWORD: ${ADMIN_PASSWORD}
2025-10-13 07:49:20 +02:00
GF_AUTH_ANONYMOUS_ENABLED: true # Enabled the Anonymous user no user/pass needed
GF_AUTH_ANONYMOUS_ORG_ROLE: Admin
GF_AUTH_DISABLE_LOGIN_FORM: true
GF_USERS_DEFAULT_THEME: light
GF_USERS_ALLOW_SIGN_UP: false
GF_FEATURE_TOGGLES_ENABLE: traceQLStreaming metricsSummary lokiFormatQuery alertmanagerRemoteOnly
GF_INSTALL_PLUGINS: yesoreyeram-infinity-datasource
2025-10-13 15:21:35 +02:00
networks:
- caddy_net
labels:
caddy: grafana.localhost
caddy.reverse_proxy: "{{upstreams 3000}}"
caddy.tls: internal
2025-10-12 18:20:29 +02:00
# Prometheus
# Prometheus is an open-source systems monitoring and alerting toolkit
# https://prometheus.io/
prometheus:
2025-10-14 09:49:29 +02:00
image: prom/prometheus:v3.6.0
2025-10-12 18:20:29 +02:00
configs:
- source: prometheus_config
target: /etc/prometheus/prometheus.yml
volumes:
- prometheus:/prometheus
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
- 9090:9090
#extra_hosts:
# - host.docker.internal=host-gateway
2025-08-27 07:51:06 +02:00
volumes:
2025-10-13 11:56:51 +02:00
caddy_config:
2025-10-14 09:06:39 +02:00
caddy_data:
2025-10-13 07:49:20 +02:00
pgadmin:
2025-08-27 07:51:06 +02:00
database_data:
2025-09-16 15:51:20 +02:00
couchdb_data:
mongodb_data:
mongodb_configdb:
2025-09-19 10:02:52 +02:00
redis_data:
neo4j_data:
neo4j_logs:
2025-10-12 18:20:29 +02:00
prometheus:
grafana:
2025-10-14 09:49:29 +02:00
superset_home:
2025-10-14 09:56:55 +02:00
rabbitmq_data:
2025-10-12 18:20:29 +02:00
configs:
pgadmin_config:
file: ./pgadmin-servers.json
2025-10-14 21:11:54 +02:00
grafana_provisioning:
file: ./grafana/provisioning
2025-10-14 10:11:46 +02:00
grafana_dashboards:
2025-10-14 21:11:54 +02:00
file: ./grafana/dashboards
2025-10-14 10:11:46 +02:00
prometheus_config:
2025-10-14 21:11:54 +02:00
file: ./prometheus.yml
2025-10-13 11:56:51 +02:00
networks:
caddy_net:
driver: bridge