feat: Add Plausible stack
This commit is contained in:
parent
8cdd14b185
commit
59ca261565
6
plausible/.env.example
Normal file
6
plausible/.env.example
Normal file
@ -0,0 +1,6 @@
|
||||
PLAUSIBLE_HOST=plausible.example.org
|
||||
ADMIN_USER_EMAIL=admin@example.org
|
||||
ADMIN_USER_NAME=admin
|
||||
ADMIN_USER_PWD=admin
|
||||
BASE_URL=http://plausible.example.org
|
||||
SECRET_KEY_BASE=secret
|
||||
15
plausible/README.md
Normal file
15
plausible/README.md
Normal file
@ -0,0 +1,15 @@
|
||||
# Plausible
|
||||
|
||||
## Run
|
||||
|
||||
Generate the secret app key with this command :
|
||||
|
||||
```bash
|
||||
openssl rand -base64 64 | tr -d '\n' ; echo
|
||||
```
|
||||
|
||||
|
||||
```bash
|
||||
cp .env.example .env # then edit
|
||||
docker compose up -d
|
||||
```
|
||||
14
plausible/clickhouse-config.xml
Normal file
14
plausible/clickhouse-config.xml
Normal 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>
|
||||
8
plausible/clickhouse-user-config.xml
Normal file
8
plausible/clickhouse-user-config.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<yandex>
|
||||
<profiles>
|
||||
<default>
|
||||
<log_queries>0</log_queries>
|
||||
<log_query_threads>0</log_query_threads>
|
||||
</default>
|
||||
</profiles>
|
||||
</yandex>
|
||||
59
plausible/docker-compose.yml
Normal file
59
plausible/docker-compose.yml
Normal file
@ -0,0 +1,59 @@
|
||||
version: '3'
|
||||
|
||||
networks:
|
||||
web:
|
||||
external: true
|
||||
plausible:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
postgres-data:
|
||||
clickhouse-data:
|
||||
|
||||
services:
|
||||
mail:
|
||||
image: bytemark/smtp
|
||||
restart: unless-stopped
|
||||
|
||||
plausible_db:
|
||||
image: postgres:14-alpine
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
environment:
|
||||
- POSTGRES_PASSWORD=postgres
|
||||
networks:
|
||||
- plausible
|
||||
|
||||
plausible_events_db:
|
||||
image: clickhouse/clickhouse-server:22.6-alpine
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- clickhouse-data:/var/lib/clickhouse
|
||||
- ./clickhouse-config.xml:/etc/clickhouse-server/config.d/logging.xml:ro
|
||||
- ./clickhouse-user-config.xml:/etc/clickhouse-server/users.d/logging.xml:ro
|
||||
ulimits:
|
||||
nofile:
|
||||
soft: 262144
|
||||
hard: 262144
|
||||
networks:
|
||||
- plausible
|
||||
|
||||
plausible:
|
||||
image: plausible/analytics:v1.5.1
|
||||
restart: unless-stopped
|
||||
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
|
||||
- mail
|
||||
env_file:
|
||||
- .env
|
||||
networks:
|
||||
- plausible
|
||||
- web
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.grafana.entrypoints=http"
|
||||
- "traefik.http.routers.grafana.rule=Host(`${PLAUSIBLE_HOST}`)"
|
||||
- "traefik.http.services.grafana.loadbalancer.server.port=8000"
|
||||
Loading…
x
Reference in New Issue
Block a user