Files
sql/compose.yaml

362 lines
9.5 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
# ----------------------------------------------------------------------
# Proxy
#
# ----------------------------------------------------------------------
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:12:42 +02:00
- "2019:2019"
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-14 07:31:52 +02:00
CADDY_DOCKER_ADMIN_API: "true"
CADDY_ADMIN: "0.0.0.0:2019"
2025-10-13 11:12:42 +02:00
volumes:
- ./data:/usr/share/caddy
2025-10-14 07:31:52 +02:00
- /var/run/docker.sock:/var/run/docker.sock:ro
2025-10-13 11:56:51 +02:00
labels:
2025-10-14 07:31:52 +02:00
caddy_admin: "2019"
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-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-12 18:20:29 +02:00
# pgAdmin
# Rich administration and development platform for PostgreSQL.
# https://www.pgadmin.org/
pgadmin:
2025-10-13 11:06:48 +02:00
image: dpage/pgadmin4:${PGADMIN_VERSION:-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
restart: "no"
configs:
- source: pgadmin_config
target: /pgadmin4/servers.json
volumes:
- pgadmin:/var/lib/pgadmin/
environment:
PGADMIN_DEFAULT_EMAIL: ${ADMIN_EMAIL}
PGADMIN_DEFAULT_PASSWORD: ${ADMIN_PASSWORD}
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
profiles:
- admin
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:
image: couchdb:${COUCH_DB_VERSION:-3.5}
volumes:
- couchdb_data:/opt/couchdb/data
ports:
- "5984:5984"
environment:
2025-10-13 21:27:02 +02:00
COUCHDB_USER: ${COUCHDB_USER}
COUCHDB_PASSWORD: ${COUCHDB_PASSWORD}
2025-10-13 11:06:48 +02:00
profiles:
- documents
2025-09-16 15:51:20 +02:00
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-10-13 11:06:48 +02:00
profiles:
- documents
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:
- 7474:7474
- 7687:7687
volumes:
- neo4j_data:/data
- neo4j_logs:/logs
environment:
NEO4J_AUTH: neo4j/${DB_ROOT_PASSWORD:-!ChangeMe!}
2025-10-13 11:06:48 +02:00
profiles:
- graph
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:
[
"--port", "${POSTGRAPHILE_PORT:-5000}",
"--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"
]
ports:
- 3006:5000
2025-10-13 12:01:58 +02:00
networks:
- caddy_net
2025-10-13 07:49:20 +02:00
environment:
- PGHOST=${POSTGRAPHILE_HOST:-postgresql}
- PGPORT=${POSTGRAPHILE_DB_PORT:-5432}
- PGUSER=${POSTGRAPHILE_DB_USER:-postgraphile}
2025-10-14 07:31:52 +02:00
- PGPASSWORD=${DB_PASSWORD:-!ChangeMe!}
2025-10-13 07:49:20 +02:00
- PGDATABASE=${COMPOSE_PROJECT_NAME}
profiles:
2025-10-13 11:56:51 +02:00
- api2
- graph2
2025-10-13 07:49:20 +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
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}
PGRST_DB_ANON_ROLE: ${POSTGREST_DB_ANON_ROLE:-role_web}
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
networks:
- caddy_net
labels:
caddy: postgrest.localhost
caddy.reverse_proxy: "{{upstreams 80}}"
caddy.tls: internal
2025-10-12 18:20:29 +02:00
profiles:
- api
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-13 21:27:02 +02:00
{ "url": "https://postgrest/?format=json" }
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
profiles:
- api
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
labels:
caddy.mock.localhost: "https://mock.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
profiles:
- mock
2025-10-13 16:35:40 +02:00
toxiproxy:
image: ghcr.io/shopify/toxiproxy
restart: "no"
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-13 21:27:02 +02:00
image: grafana/grafana-oss:12.2
2025-10-12 18:20:29 +02:00
restart: no
depends_on:
- loki
deploy:
resources:
limits:
memory: 100M
configs:
- source: grafana_datasources
target: /etc/grafana/provisioning/datasources
- 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
profiles:
- telemetry
# Prometheus
# Prometheus is an open-source systems monitoring and alerting toolkit
# https://prometheus.io/
prometheus:
2025-10-13 21:27:02 +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
profiles:
- telemetry
2025-08-27 07:51:06 +02:00
volumes:
2025-10-13 11:56:51 +02:00
caddy_config:
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:
configs:
pgadmin_config:
file: ./pgadmin-servers.json
2025-10-13 11:56:51 +02:00
networks:
caddy_net:
driver: bridge