infrastructure/ansible/roles/plausible/files/docker-compose.yml
2020-09-08 20:41:47 +01:00

52 lines
1.7 KiB
YAML

version: "2.3"
services:
plausible:
image: plausible/analytics:latest
restart: unless-stopped
command: sh -c "/entrypoint.sh db migrate && /entrypoint.sh run"
depends_on:
- db
- clickhouse
expose:
- 8000 # https://github.com/plausible/analytics/pull/237
labels:
- traefik.enable=true
- traefik.http.routers.plausible.rule=Host(`plausible.theorangeone.net`)
- traefik.http.routers.plausible.tls.certresolver=le
- traefik.http.routers.plausible.middlewares=compress@file
environment:
- SECRET_KEY_BASE={{ secret_key }}
- SIGNING_SALT={{ signing_salt }}
- DATABASE_URL=postgres://plausible:plausible@db:5432/plausible
- DISABLE_REGISTRATION=true
- DISABLE_SUBSCRIPTION=true
- CLICKHOUSE_DATABASE_HOST=clickhouse
- CLICKHOUSE_DATABASE_NAME=plausible
- DATABASE_POOL_SIZE=20
- CLICKHOUSE_DATABASE_POOLSIZE=20
- HOST=plausible.theorangeone.net
- SCHEME=https
clickhouse:
image: yandex/clickhouse-server:latest
restart: unless-stopped
volumes:
- /mnt/tank/dbs/clickhouse/plausible:/var/lib/clickhouse
- /mnt/tank/dbs/clickhouse/docker_related_config.xml:/etc/clickhouse-server/config.d/docker_related_config.xml:ro
- /mnt/tank/dbs/clickhouse/docker_related_user_config.xml:/etc/clickhouse-server/users.d/docker_related_user_config.xml:ro
tmpfs:
- /var/log/clickhouse-server
ulimits:
nofile:
soft: 262144
hard: 262144
db:
image: postgres:12-alpine
restart: unless-stopped
volumes:
- /mnt/tank/dbs/postgres/plausible:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=plausible
- POSTGRES_USER=plausible