diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..aa0383b --- /dev/null +++ b/.env.example @@ -0,0 +1,9 @@ +PG_PASSWORD=!ChangeMe! + +#pgAdmin +ADMIN_EMAIL=user@email.org +ADMIN_PASSWORD=!ChangeMe! + +# CouchDB +COUCHDB_USER=admin +COUCHDB_PASSWORD=!ChangeMe! diff --git a/compose.bi.yaml b/compose.bi.yaml new file mode 100644 index 0000000..819f2ce --- /dev/null +++ b/compose.bi.yaml @@ -0,0 +1,76 @@ +# ---------------------------------------------------------------------- +# 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 + profiles: + - bi + + 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 + profiles: + - bi + + metabase-init: + build: + context: ./metabase + depends_on: + - metabase + profiles: + - bi + +volumes: + superset_home: diff --git a/compose.yaml b/compose.yaml index 3d7b04a..380ec78 100644 --- a/compose.yaml +++ b/compose.yaml @@ -49,7 +49,7 @@ services: POSTGRES_USER: ${COMPOSE_PROJECT_NAME} volumes: - database_data:/var/lib/postgresql:rw - - ./docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d:Z + - ./postgresql-entrypoint-initdb.d:/docker-entrypoint-initdb.d:Z - ./data:/tmp:z ports: - "5432:5432" @@ -88,80 +88,6 @@ services: profiles: - admin -# ---------------------------------------------------------------------- -# 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 - profiles: - - bi - - 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 - profiles: - - bi - - metabase-init: - build: - context: ./metabase - depends_on: - - metabase - profiles: - - bi - # ---------------------------------------------------------------------- # Documents # @@ -177,8 +103,8 @@ services: ports: - "5984:5984" environment: - COUCHDB_USER: ${DB_ROOT_USER:-admin} - COUCHDB_PASSWORD: ${DB_ROOT_PASSWORD:-!ChangeMe!} + COUCHDB_USER: ${COUCHDB_USER} + COUCHDB_PASSWORD: ${COUCHDB_PASSWORD} profiles: - documents @@ -195,8 +121,8 @@ services: ports: - "27017:27017" environment: - MONGODB_INITDB_ROOT_USERNAME: ${DB_ROOT_USER:-admin} - MONGODB_INITDB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:-!ChangeMe!} + MONGODB_INITDB_ROOT_USERNAME: ${MONGODB_USER} + MONGODB_INITDB_ROOT_PASSWORD: ${MONGODB_PASSWORD} profiles: - documents @@ -209,11 +135,11 @@ services: - 'redis-server' - '--save 60 1' - '--loglevel verbose' - - '--requirepass ${DB_ROOT_PASSWORD:-!ChangeMe!}' + - '--requirepass ${REDIS_PASSWORD}' ports: - "6379:6379" healthcheck: - test: ["CMD", "redis-cli", "-a", "${DB_ROOT_PASSWORD:-!ChangeMe!}", "--raw", "incr", "ping" ] + test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD}", "--raw", "incr", "ping" ] interval: 30s timeout: 5s retries: 3 @@ -280,8 +206,7 @@ services: # 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. -# https://docs.postgrest.org/en/v12/ - +# https://docs.postgrest.org/en/v13/ postgrest: image: postgrest/postgrest:v13.0.7 restart: "no" @@ -305,6 +230,9 @@ services: profiles: - api +# Scalar +# Create world-class API Docs with a built-in interactive playground +# which seamlessly turns to a full featured API Client scalar: image: scalarapi/api-reference:0.4.2 restart: "no" @@ -312,7 +240,7 @@ services: API_REFERENCE_CONFIG: | { "sources":[ - { "url": "https://registry.scalar.com/@scalar/apis/galaxy/latest?format=json" } + { "url": "https://postgrest/?format=json" } ], "theme": "purple" } @@ -355,9 +283,8 @@ services: # Grafana # Open source analytics & monitoring solution for every database. # https://grafana.com/ - grafana: - image: grafana/grafana-oss:${GRAFANA_VERSION:-12.2} + image: grafana/grafana-oss:12.2 restart: no depends_on: - loki @@ -394,9 +321,8 @@ services: # Prometheus # Prometheus is an open-source systems monitoring and alerting toolkit # https://prometheus.io/ - prometheus: - image: prom/prometheus:${PROMETHEUS_VERSION:-v3.6.0} + image: prom/prometheus:-v3.6.0 configs: - source: prometheus_config target: /etc/prometheus/prometheus.yml @@ -414,7 +340,6 @@ volumes: caddy_config: pgadmin: database_data: - superset_home: couchdb_data: mongodb_data: mongodb_configdb: