app-store/apps/plausible/docker-compose.yml
DrMxrcy 9f7815d341 Add Plausible (#475)
* Add Plausible Analytics

* Update config.json

* Update docker-compose.yml

* Update docker-compose.yml

* Update docker-compose.yml

* Update docker-compose.yml

* Update Secret Key

* Remove User Registration, Done Via UI

* Update docker-compose.yml

* Update docker-compose.yml

* Update config.json
2023-05-10 13:18:44 +02:00

57 lines
2.0 KiB
YAML

version: "3.7"
services:
plausible-db:
# supported versions are 12, 13, and 14
image: postgres:14-alpine
container_name: plausible-db
restart: always
networks:
- tipi_main_network
volumes:
- ${APP_DATA_DIR}/data/database/:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=${PLAUSIBLE_DB_PASSWORD}
- POSTGRES_USER=tipi
- POSTGRES_DB=plausible-db
plausible-events-db:
container_name: plausible-events-db
image: clickhouse/clickhouse-server:22.6-alpine
restart: always
networks:
- tipi_main_network
volumes:
- ${APP_DATA_DIR}/data/plausible-event-data:/var/lib/clickhouse
- ${APP_DATA_DIR}/data/clickhouse/clickhouse-config.xml:/etc/clickhouse-server/config.d/logging.xml:ro
- ${APP_DATA_DIR}/data/clickhouse/clickhouse-user-config.xml:/etc/clickhouse-server/users.d/logging.xml:ro
ulimits:
nofile:
soft: 262144
hard: 262144
plausible:
container_name: plausible
image: plausible/analytics:v1.5.1
restart: always
command: sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh db init-admin && /entrypoint.sh run"
depends_on:
- plausible-db
- plausible-events-db
ports:
- ${APP_PORT}:8000
environment:
- BASE_URL=${APP_PROTOCOL:-http}://${APP_DOMAIN}
- SECRET_KEY_BASE=${PLAUSIBLE_SECRET_KEY_BASE}
- DATABASE_URL=postgres://tipi:${PLAUSIBLE_DB_PASSWORD}@plausible-db:5432/plausible-db
- CLICKHOUSE_DATABASE_URL=http://plausible-events-db:8123/plausible_events_db
- DISABLE_REGISTRATION=${PLAUSIBLE_DISABLE_REGISTRATION}
networks:
- tipi_main_network
labels:
traefik.enable: ${APP_EXPOSED}
traefik.http.routers.plausible.rule: Host(`${APP_DOMAIN}`)
traefik.http.routers.plausible.entrypoints: websecure
traefik.http.routers.plausible.service: plausible
traefik.http.routers.plausible.tls.certresolver: myresolver
traefik.http.services.plausible.loadbalancer.server.port: 8000