Skip to content

Commit fbd214f

Browse files
author
Mafyuh
committedDec 22, 2024
add plausible
1 parent d4ccc55 commit fbd214f

File tree

2 files changed

+97
-1
lines changed

2 files changed

+97
-1
lines changed
 

‎.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,7 @@ terraform.rc
4646
credentials.pkr.hcl
4747

4848
## Testing
49-
/docker/health
49+
/docker/health
50+
51+
# Plausible
52+
compose.override.yml

‎docker/plausible/compose.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
services:
2+
plausible_db:
3+
image: postgres:16-alpine
4+
restart: always
5+
volumes:
6+
- db-data:/var/lib/postgresql/data
7+
environment:
8+
- POSTGRES_PASSWORD=postgres
9+
healthcheck:
10+
test: ["CMD-SHELL", "pg_isready -U postgres"]
11+
start_period: 1m
12+
13+
plausible_events_db:
14+
image: clickhouse/clickhouse-server:24.3.3.102-alpine
15+
restart: always
16+
volumes:
17+
- event-data:/var/lib/clickhouse
18+
- event-logs:/var/log/clickhouse-server
19+
- /home/mafyuh/plausible-ce/clickhouse/logs.xml:/etc/clickhouse-server/config.d/logs.xml:ro
20+
# This makes ClickHouse bind to IPv4 only, since Docker doesn't enable IPv6 in bridge networks by default.
21+
# Fixes "Listen [::]:9000 failed: Address family for hostname not supported" warnings.
22+
- /home/mafyuh/plausible-ce/clickhouse/ipv4-only.xml:/etc/clickhouse-server/config.d/ipv4-only.xml:ro
23+
# This makes ClickHouse consume less resources, which is useful for small setups.
24+
# https://clickhouse.com/docs/en/operations/tips#using-less-than-16gb-of-ram
25+
- /home/mafyuh/plausible-ce/clickhouse/low-resources.xml:/etc/clickhouse-server/config.d/low-resources.xml:ro
26+
ulimits:
27+
nofile:
28+
soft: 262144
29+
hard: 262144
30+
healthcheck:
31+
test: ["CMD-SHELL", "wget --no-verbose --tries=1 -O - http://127.0.0.1:8123/ping || exit 1"]
32+
start_period: 1m
33+
34+
plausible:
35+
image: ghcr.io/plausible/community-edition:v2.1.4
36+
restart: always
37+
command: sh -c "/entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run"
38+
depends_on:
39+
plausible_db:
40+
condition: service_healthy
41+
plausible_events_db:
42+
condition: service_healthy
43+
volumes:
44+
- plausible-data:/var/lib/plausible
45+
ulimits:
46+
nofile:
47+
soft: 65535
48+
hard: 65535
49+
environment:
50+
- TMPDIR=/var/lib/plausible/tmp
51+
# required: https://github.com/plausible/community-edition/wiki/configuration#required
52+
- BASE_URL=${BASE_URL}
53+
- SECRET_KEY_BASE=${SECRET_KEY_BASE}
54+
# optional: https://github.com/plausible/community-edition/wiki/configuration#optional
55+
# registration: https://github.com/plausible/community-edition/wiki/configuration#registration
56+
- TOTP_VAULT_KEY
57+
- DISABLE_REGISTRATION
58+
- ENABLE_EMAIL_VERIFICATION
59+
# web: https://github.com/plausible/community-edition/wiki/configuration#web
60+
- HTTP_PORT
61+
- HTTPS_PORT
62+
# databases: https://github.com/plausible/community-edition/wiki/configuration#database
63+
- DATABASE_URL
64+
- CLICKHOUSE_DATABASE_URL
65+
# Google: https://github.com/plausible/community-edition/wiki/configuration#google
66+
- GOOGLE_CLIENT_ID
67+
- GOOGLE_CLIENT_SECRET
68+
# geolocation: https://github.com/plausible/community-edition/wiki/configuration#ip-geolocation
69+
- IP_GEOLOCATION_DB
70+
- GEONAMES_SOURCE_FILE
71+
- MAXMIND_LICENSE_KEY
72+
- MAXMIND_EDITION
73+
# email: https://github.com/plausible/community-edition/wiki/configuration#email
74+
- MAILER_ADAPTER
75+
- MAILER_EMAIL
76+
- MAILER_NAME
77+
- SMTP_HOST_ADDR
78+
- SMTP_HOST_PORT
79+
- SMTP_USER_NAME
80+
- SMTP_USER_PWD
81+
- SMTP_HOST_SSL_ENABLED
82+
- POSTMARK_API_KEY
83+
- MAILGUN_API_KEY
84+
- MAILGUN_DOMAIN
85+
- MAILGUN_BASE_URI
86+
- MANDRILL_API_KEY
87+
- SENDGRID_API_KEY
88+
89+
volumes:
90+
db-data:
91+
event-data:
92+
event-logs:
93+
plausible-data:

0 commit comments

Comments
 (0)
Please sign in to comment.