infrastructure/ansible/roles/plausible/files/docker-compose.yml
Jake Howard 48934ad2c5
Apply gzip to everything
The middleware is smart enough to only apply it when needed, and only when it's not already compressed, so it's fine.
2021-09-19 22:48:48 +01:00

56 lines
2 KiB
YAML

version: "2.3"
services:
plausible:
image: plausible/analytics:v1.3
restart: unless-stopped
command: sh -c "/entrypoint.sh db migrate && /entrypoint.sh run"
depends_on:
- db
- clickhouse
labels:
- traefik.enable=true
- traefik.http.routers.plausible.rule=Host(`plausible.theorangeone.net`)
- traefik.http.services.plausible-plausible.loadbalancer.server.port=8000 # https://github.com/plausible/analytics/pull/237
- traefik.http.routers.plausible.tls.certresolver=le
- traefik.http.routers.plausible-bare.rule=Host(`elbisualp.theorangeone.net`)
- traefik.http.routers.plausible-bare.tls.certresolver=le
- traefik.http.routers.plausible-bare.service=plausible-plausible
# https://github.com/plausible/analytics/pull/340
- traefik.http.middlewares.plausible-index.replacepathregex.regex=/js/index.js
- traefik.http.middlewares.plausible-index.replacepathregex.replacement=/js/plausible.js
- traefik.http.routers.plausible-bare.middlewares=plausible-index
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_URL=http://clickhouse:8123/plausible
- BASE_URL=https://elbisualp.theorangeone.net
clickhouse:
image: yandex/clickhouse-server:21.6-alpine
restart: unless-stopped
volumes:
- ./clickhouse:/var/lib/clickhouse
- ./docker_related_config.xml:/etc/clickhouse-server/config.d/docker_related_config.xml:ro
- ./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:
- ./postgres:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=plausible
- POSTGRES_USER=plausible