Files
docker-compose-template/auto/compose.plausible.yaml
T
Viren070 a1fa6d67ca test 2
2025-02-17 23:51:05 +00:00

64 lines
2.2 KiB
YAML

services:
plausible_db:
image: postgres:16-alpine
restart: unless-stopped
container_name: plausible-db
volumes:
- plausible-db:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
start_period: 1m
plausible_events_db:
image: clickhouse/clickhouse-server:24.3.3.102-alpine
restart: unless-stopped
container_name: plausible-events-db
volumes:
- plausible-event-db:/var/lib/clickhouse
- plausible-event-logs:/var/log/clickhouse-server
- ./data/plausible/clickhouse/logs.xml:/etc/clickhouse-server/config.d/logs.xml:ro
- ./data/plausible/clickhouse/ipv4-only.xml:/etc/clickhouse-server/config.d/ipv4-only.xml:ro
- ./data/plausible/clickhouse/low-resources.xml:/etc/clickhouse-server/config.d/low-resources.xml:ro
ulimits:
nofile:
soft: 262144
hard: 262144
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 -O - http://127.0.0.1:8123/ping || exit 1"]
start_period: 1m
plausible:
image: ghcr.io/plausible/community-edition:latest
container_name: plausible
restart: unless-stopped
command: sh -c "/entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run"
depends_on:
plausible_db:
condition: service_healthy
plausible_events_db:
condition: service_healthy
volumes:
- plausible-data:/var/lib/plausible
ulimits:
nofile:
soft: 65535
hard: 65535
expose:
- 8000
environment:
TMPDIR: /var/lib/plausible/tmp
BASE_URL: https://${PLAUSIBLE_HOSTNAME}
SECRET_KEY_BASE: ${PLAUSIBLE_SECRET_KEY_BASE}
HTTP_PORT: 8000
labels:
- "traefik.enable=true"
- "traefik.http.routers.plausible.rule=Host(`${PLAUSIBLE_HOSTNAME}`)"
- "traefik.http.routers.plausible.entrypoints=websecure"
- "traefik.http.routers.plausible.tls.certresolver=myresolver"
- "traefik.http.services.plausible.loadbalancer.server.port=8000"
- "flame.type=app"
- "flame.name=Plausible"
- "flame.url=https://${PLAUSIBLE_HOSTNAME}"