services: plausible_db: image: postgres:16-alpine restart: always volumes: - db-data:/var/lib/postgresql/data environment: - POSTGRES_PASSWORD=postgres healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] start_period: 1m networks: - internal plausible_events_db: image: clickhouse/clickhouse-server:24.12-alpine restart: always volumes: - event-data:/var/lib/clickhouse - event-logs:/var/log/clickhouse-server - ./clickhouse/logs.xml:/etc/clickhouse-server/config.d/logs.xml:ro - ./clickhouse/ipv4-only.xml:/etc/clickhouse-server/config.d/ipv4-only.xml:ro - ./clickhouse/low-resources.xml:/etc/clickhouse-server/config.d/low-resources.xml:ro - ./clickhouse/default-profile-low-resources-overrides.xml:/etc/clickhouse-server/users.d/default-profile-low-resources-overrides.xml:ro ulimits: nofile: soft: 262144 hard: 262144 environment: - CLICKHOUSE_SKIP_USER_SETUP=1 healthcheck: test: ["CMD-SHELL", "wget --no-verbose --tries=1 -O - http://127.0.0.1:8123/ping || exit 1"] start_period: 1m networks: - internal plausible: image: ghcr.io/plausible/community-edition:v3.2.0 restart: always command: sh -c "/entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run" depends_on: plausible_db: condition: service_healthy plausible_events_db: condition: service_healthy volumes: - plausible-data:/var/lib/plausible ulimits: nofile: soft: 65535 hard: 65535 environment: - TMPDIR=/var/lib/plausible/tmp - BASE_URL=${BASE_URL} - SECRET_KEY_BASE=${SECRET_KEY_BASE} - DATABASE_URL=postgres://postgres:postgres@plausible_db:5432/plausible_db - CLICKHOUSE_DATABASE_URL=http://plausible_events_db:8123/plausible_events_db networks: - internal - caddy_ntwk networks: caddy_ntwk: external: true internal: driver: bridge volumes: db-data: event-data: event-logs: plausible-data: