From 30cb569e35a884900ceeda491b1f76d8d9710b83 Mon Sep 17 00:00:00 2001 From: "Eduardo Enriquez (eduzen)" Date: Mon, 12 May 2025 09:24:58 +0200 Subject: [PATCH] Add Plausible Analytics service to Docker Compose configuration - Introduced new services for Plausible Analytics, including `plausible`, `plausible_db`, and `plausible_events_db`. - Configured environment variables for database connections and application settings. - Updated port mapping for the Plausible web service to avoid conflicts. These changes aim to integrate Plausible Analytics into the existing Docker setup, enhancing analytics capabilities. --- docker-compose.yml | 46 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 3f677509..56b79adc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,6 +2,8 @@ volumes: pgdata: shell_history: ipy_history: + plausible_db_data: + plausible_event_data: services: web: @@ -53,9 +55,43 @@ services: expose: - "6379" - adminer: - image: adminer:latest - profiles: ["debug"] - restart: always + plausible: + image: plausible/analytics:latest + container_name: plausible + command: sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run" ports: - - 8000:8000 + - "8010:8000" + depends_on: + - plausible_db + - plausible_events_db + environment: + - SECRET_KEY_BASE=Cw0pgBXLqnmVnL48KcDgLCgU5dvqI2hHxEPWcUJNtX1PqQ7Vr9kYV4wRTP9mZKRK10LILXuJMvD1Hl7NLPkI9Xu2vCU3 + - ADMIN_USER_EMAIL=me@eduzen.ar + - ADMIN_USER_PASSWORD=test + - BASE_URL=http://localhost:8010 + - DATABASE_URL=postgres://postgres:postgres@plausible_db:5432/plausible + - CLICKHOUSE_DATABASE_URL=http://plausible_events_db:8123/plausible + + plausible_db: + image: postgres:14-alpine + container_name: plausible_db + restart: always + volumes: + - plausible_db_data:/var/lib/postgresql/data + environment: + - POSTGRES_PASSWORD=postgres + - POSTGRES_USER=postgres + - POSTGRES_DB=plausible + + plausible_events_db: + image: clickhouse/clickhouse-server:22.6-alpine + container_name: plausible_events_db + restart: always + volumes: + - plausible_event_data:/var/lib/clickhouse + ulimits: + nofile: + soft: 262144 + hard: 262144 + environment: + - CLICKHOUSE_DB=plausible