infrastructure/ansible/roles/plausible/files/docker-compose.yml

67 lines
1.9 KiB
YAML
Raw Normal View History

2020-07-21 20:55:44 +01:00
version: "2.3"
services:
plausible:
image: plausible/analytics:latest
2020-08-04 19:38:01 +01:00
restart: unless-stopped
2020-08-04 22:07:45 +01:00
command: sh -c "/entrypoint.sh db migrate && /entrypoint.sh run"
2020-07-21 20:55:44 +01:00
depends_on:
- db
- clickhouse
expose:
2020-07-28 20:31:32 +01:00
- 8000 # https://github.com/plausible/analytics/pull/237
2020-07-21 20:55:44 +01:00
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
2020-07-21 20:55:44 +01:00
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
2020-07-26 15:40:03 +01:00
- DATABASE_POOL_SIZE=20
- CLICKHOUSE_DATABASE_POOLSIZE=20
2020-07-21 20:55:44 +01:00
- HOST=plausible.theorangeone.net
- SCHEME=https
clickhouse:
image: yandex/clickhouse-server:latest
2020-08-04 19:38:01 +01:00
restart: unless-stopped
2020-07-21 20:55:44 +01:00
volumes:
- ./clickhouse:/var/lib/clickhouse
- /mnt/tank/dbs/clickhouse/docker_related_config.xml:/etc/clickhouse-server/config.d/docker_related_config.xml:ro
tmpfs:
- /var/log/clickhouse-server
2020-07-21 20:55:44 +01:00
ulimits:
nofile:
soft: 262144
hard: 262144
db:
image: postgres:12-alpine
restart: unless-stopped
volumes:
2020-08-22 12:19:47 +01:00
- /mnt/tank/dbs/postgres/plausible:/var/lib/postgresql/data
2020-07-21 20:55:44 +01:00
environment:
- POSTGRES_PASSWORD=plausible
- POSTGRES_USER=plausible
2020-08-04 19:49:21 +01:00
db-backups:
image: prodrigestivill/postgres-backup-local:12-alpine
restart: unless-stopped
volumes:
- /scratch/db-backups:/backups
depends_on:
- db
environment:
- POSTGRES_HOST=db
- POSTGRES_PASSWORD=plausible
- POSTGRES_USER=plausible
- POSTGRES_DB=plausible
- BACKUP_KEEP_MONTHS=1
- BACKUP_KEEP_WEEKS=1