feat(Plausible): Add new service

This commit is contained in:
Simon 2022-02-22 16:02:03 +01:00
parent 895623732f
commit 5d4d7ad7fb
12 changed files with 189 additions and 0 deletions

View File

@ -10,6 +10,7 @@ Vous trouverez dans ce dépôt l'ensemble des services Open Source que RésiLien
- [HedgeDoc](./hedgedoc) : Prise de note en Markdown collaborative en temps réel
- [Mobilizon](./mobilizon): Permet l'organisation d'évènements et de gestion de groupes
- [Nextcloud](./nextcloud) : Site d'hébergement de fichiers et une plateforme de collaboration
- [Plausible](./plausible) : Plausible est une plateforme d'analyse Web légère et open source.
### Pour les devs / ops

68
plausible/.env Normal file
View File

@ -0,0 +1,68 @@
########
# DOCKER
#DOCKER_CONTEXT=
#DOCKER_HOST=
SERVICES_DIR=..
COMPOSE_FILE=${SERVICES_DIR}/plausible/docker-compose.yml:${SERVICES_DIR}/plausible/docker-compose.clickhouse.yml:${SERVICES_DIR}/plausible/docker-compose.local.yml:${SERVICES_DIR}/postgres/docker-compose.yml:${SERVICES_DIR}/clickhouse/docker-compose.yml
#COMPOSE_PROJECT_NAME=
## APP
PLAUSIBLE_DOMAIN=http://localhost:8000
#PLAUSIBLE_CONTAINER_NAME=plausible
#PLAUSIBLE_VOLUME_NAME=plausible
#PLAUSIBLE_IMAGE=plausible/analytics:v1.4.4
ADMIN_USER_NAME=example
ADMIN_USER_EMAIL=email@example.org
ADMIN_USER_PWD=change-me
SECRET_KEY_BASE=AFnMQwN54ovHIqCQQGFZX5gUFpgpxasCEnzQwQsyfZLPRbiwzDYAqYDJQlQM8SbmicVJr97axXaSCfXD9zSEQQ==
## POSTGRES
#POSTGRES_VOLUME_NAME=
#POSTGRES_CONTAINER_NAME=
#POSTGRES_IMAGE=
POSTGRES_USER=user-example
POSTGRES_PASSWORD=password-example
POSTGRES_DB=plausible_dev
## CLICKHOUSE
#CLICKHOUSE_VOLUME_NAME=
#CLICKHOUSE_CONTAINER_NAME=
#CLICKHOUSE_IMAGE=
## SMTP
#MAILER_EMAIL=
#SMTP_HOST_ADDR=
#SMTP_HOST_PORT=
#SMTP_USER_NAME=
#SMTP_USER_PWD=
#SMTP_HOST_SSL_ENABLED=
#SMTP_RETRIES=
## GOOGLE SEARCH CONSOLE
#GOOGLE_CLIENT_ID=
#GOOGLE_CLIENT_SECRET=
## GEOIPUPDATE
#GEOIPUPDATE_VOLUME_NAME=
#GEOIPUPDATE_IMAGE=
#GEOIPUPDATE_CONTAINER_NAME=
#GEOIPUPDATE_ACCOUNT_ID=
#GEOIPUPDATE_LICENSE_KEY=
#GEOIPUPDATE_EDITION_IDS=GeoLite2-Country
#GEOIPUPDATE_FREQUENCY=
#GEOIPUPDATE_VERBOSE=
#GEOIPUPDATE_DB_DIR=
## TRAEFIK
#TRAEFIK_NETWORK_NAME=
#TRAEFIK_ROUTER_NAME=
#TRAEFIK_ENTRYPOINTS=

15
plausible/README.md Normal file
View File

@ -0,0 +1,15 @@
# Plausible
> Plausible est une plateforme d'analyse Web légère et open source.
## Liens
- [Site Officiel][site]
- [Documentation][documentation]
- [Code source][source]
- [Docker Hub][dockerhub]
[site]: https://plausible.io/
[source]: https://github.com/plausible/analytics
[documentation]: https://plausible.io/docs
[dockerhub]: https://hub.docker.com/r/plausible/analytics

View File

@ -0,0 +1,14 @@
<yandex>
<logger>
<level>warning</level>
<console>true</console>
</logger>
<!-- Stop all the unnecessary logging -->
<query_thread_log remove="remove"/>
<query_log remove="remove"/>
<text_log remove="remove"/>
<trace_log remove="remove"/>
<metric_log remove="remove"/>
<asynchronous_metric_log remove="remove"/>
</yandex>

View File

@ -0,0 +1,8 @@
<yandex>
<profiles>
<default>
<log_queries>0</log_queries>
<log_query_threads>0</log_query_threads>
</default>
</profiles>
</yandex>

View File

@ -0,0 +1,7 @@
version: "3.8"
services:
clickhouse:
volumes:
- ./clickhouse-config.xml:/etc/clickhouse-server/config.d/logging.xml:ro
- ./clickhouse-user-config.xml:/etc/clickhouse-server/users.d/logging.xml:ro

View File

@ -0,0 +1,10 @@
version: "3.8"
services:
plausible:
depends_on:
- geoipupdate
environment:
- GEOLITE2_COUNTRY_DB=/geoip/GeoLite2-Country.mmdb
volumes:
- geoipupdate:/geoip:ro

View File

@ -0,0 +1,7 @@
version: "3.8"
services:
plausible:
environment:
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:?err}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET:?err}

View File

@ -0,0 +1,6 @@
version: "3.8"
services:
plausible:
ports:
- ${LOCAL_PORT:-8000}:8000

View File

@ -0,0 +1,12 @@
version: "3.8"
services:
plausible:
environment:
MAILER_EMAIL: ${MAILER_EMAIL:-hello@plausible.local}
SMTP_HOST_ADDR: ${SMTP_HOST_ADDR:-localhost}
SMTP_HOST_PORT: ${SMTP_HOST_PORT:-25}
SMTP_USER_NAME: ${SMTP_USER_NAME}
SMTP_USER_PWD: ${SMTP_USER_PWD}
SMTP_HOST_SSL_ENABLED: ${SMTP_HOST_SSL_ENABLED:-false}
SMTP_RETRIES: ${SMTP_RETRIES:-2}

View File

@ -0,0 +1,13 @@
version: "3.8"
networks:
default:
name: ${TRAEFIK_NETWORK_NAME:-traefik}
services:
plausible:
labels:
- traefik.enable=true
- traefik.docker.network=${TRAEFIK_NETWORK_NAME:-traefik}
- traefik.http.routers.${TRAEFIK_ROUTER_NAME:-plausible}.rule=Host(`${PLAUSIBLE_DOMAIN:?err}`)
- traefik.http.routers.${TRAEFIK_ROUTER_NAME:-plausible}.entrypoints=${TRAEFIK_ENTRYPOINTS:-web}

View File

@ -0,0 +1,28 @@
version: "3.8"
volumes:
plausible:
name: ${PLAUSIBLE_VOLUME_NAME:-plausible}
services:
plausible:
container_name: ${PLAUSIBLE_CONTAINER_NAME:-plausible}
image: ${PLAUSIBLE_IMAGE:-plausible/analytics:v1.4.4}
restart: always
command: ${PLAUSIBLE_DOCKER_COMMAND:-sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh db init-admin && /entrypoint.sh run"}
depends_on:
- clickhouse
- postgres
environment:
ADMIN_USER_NAME: ${ADMIN_USER_NAME:?err}
ADMIN_USER_EMAIL: ${ADMIN_USER_EMAIL:?err}
ADMIN_USER_PWD: ${ADMIN_USER_PWD:?err}
BASE_URL: ${PLAUSIBLE_DOMAIN}
SECRET_KEY_BASE: ${SECRET_KEY_BASE:?err}
DISABLE_AUTH: ${DISABLE_AUTH:-false}
DISABLE_REGISTRATION: ${DISABLE_REGISTRATION:-false}
DATABASE_URL: postgres://${POSTGRES_USER:?err}:${POSTGRES_PASSWORD:?err}@${POSTGRES_CONTAINER_NAME:-postgres}:5432/${POSTGRES_DB:?err}
CLICKHOUSE_DATABASE_URL: http://${CLICKHOUSE_CONTAINER_NAME:-clickhouse}:8123/${CLICKHOUSE_CONTAINER_NAME:-clickhouse}
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro