mirror of
https://github.com/Viren070/docker-compose-template.git
synced 2025-12-01 23:17:00 +01:00
75 lines
2.4 KiB
YAML
75 lines
2.4 KiB
YAML
services:
|
|
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"
|
|
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
|
|
DATABASE_URL: "postgres://plausible:plausible@plausible_postgres:5432/plausible"
|
|
CLICKHOUSE_DATABASE_URL: "http://plausible_clickhouse:8123/plausible_events_db"
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.plausible.rule=Host(`${PLAUSIBLE_HOSTNAME?}`)"
|
|
- "traefik.http.routers.plausible.entrypoints=websecure"
|
|
- "traefik.http.routers.plausible.tls.certresolver=letsencrypt"
|
|
- "traefik.http.services.plausible.loadbalancer.server.port=8000"
|
|
volumes:
|
|
- ${DOCKER_DATA_DIR}/plausible/data:/var/lib/plausible
|
|
depends_on:
|
|
plausible_postgres:
|
|
condition: service_healthy
|
|
plausible_clickhouse:
|
|
condition: service_healthy
|
|
profiles:
|
|
- plausible
|
|
- all
|
|
|
|
plausible_clickhouse:
|
|
image: clickhouse/clickhouse-server:24.3.3.102-alpine
|
|
restart: unless-stopped
|
|
container_name: plausible_clickhouse
|
|
volumes:
|
|
- ${DOCKER_DATA_DIR}/plausible/clickhouse/db:/var/lib/clickhouse
|
|
- ${DOCKER_DATA_DIR}/plausible/clickhouse/logs:/var/log/clickhouse-server
|
|
- ./logs.xml:/etc/clickhouse-server/config.d/logs.xml:ro
|
|
- ./ipv4-only.xml:/etc/clickhouse-server/config.d/ipv4-only.xml:ro
|
|
- ./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
|
|
profiles:
|
|
- plausible
|
|
- all
|
|
|
|
plausible_postgres:
|
|
image: postgres:16-alpine
|
|
restart: unless-stopped
|
|
container_name: plausible_postgres
|
|
volumes:
|
|
- ${DOCKER_DATA_DIR}/plausible/postgres:/var/lib/postgresql/data
|
|
environment:
|
|
POSTGRES_USER: plausible
|
|
POSTGRES_PASSWORD: plausible
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U plausible"]
|
|
start_period: 1m
|
|
profiles:
|
|
- plausible
|
|
- all
|
|
|
|
|