plausible-hosting/compose.yml

58 lines
1.6 KiB
YAML
Raw Normal View History

2024-09-04 04:11:58 -05:00
services:
plausible_db:
image: postgres:16-alpine
restart: always
volumes:
- db-data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=postgres
2024-09-13 01:31:10 -05:00
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
2024-09-13 01:38:57 -05:00
start_interval: 2s
start_period: 1m
2024-09-04 04:11:58 -05:00
plausible_events_db:
image: clickhouse/clickhouse-server:24.3.3.102-alpine
restart: always
volumes:
- event-data:/var/lib/clickhouse
- event-logs:/var/log/clickhouse-server
2024-09-13 01:52:58 -05:00
- ./clickhouse/logs.xml:/etc/clickhouse-server/config.d/logs.xml:ro
# This makes ClickHouse bind to IPv4 only, since Docker doesn't support IPv6 by default.
- ./clickhouse/ipv4.xml:/etc/clickhouse-server/config.d/ipv4.xml:ro
2024-09-04 04:11:58 -05:00
ulimits:
nofile:
soft: 262144
hard: 262144
2024-09-13 01:31:10 -05:00
healthcheck:
2024-09-13 01:38:57 -05:00
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:8123/ping || exit 1"]
start_interval: 2s
start_period: 1m
2024-09-04 04:11:58 -05:00
plausible:
image: ghcr.io/plausible/community-edition:v2.1.2
restart: always
2024-09-13 01:27:48 -05:00
command: sh -c "/entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run"
2024-09-04 04:11:58 -05:00
depends_on:
2024-09-13 01:31:10 -05:00
plausible_db:
condition: service_healthy
plausible_events_db:
condition: service_healthy
2024-09-13 02:04:43 -05:00
# Note that setting ports opens firewall for external access.
2024-09-04 04:11:58 -05:00
ports:
2024-09-13 02:04:43 -05:00
- 80:80
- 443:443
2024-09-04 04:11:58 -05:00
volumes:
- plausible-data:/var/lib/plausible
environment:
2024-09-13 01:27:48 -05:00
- BASE_URL=${BASE_URL}
- SECRET_KEY_BASE=${SECRET_KEY_BASE}
2024-09-13 02:04:43 -05:00
- HTTP_PORT=80
- HTTPS_PORT=443
2024-09-04 04:11:58 -05:00
volumes:
db-data:
event-data:
event-logs:
plausible-data: