manifests/plausible/compose.yml
2025-04-12 13:11:34 +08:00

113 lines
4.2 KiB
YAML

services:
db:
image: dockerio.cchk1.skybyte.me/library/postgres:16-alpine
restart: always
labels:
kompose.controller.type: statefulset
kompose.volume.type: persistentVolumeClaim
kompose.volume.storage-class-name: local-tgz1
kompose.volume.size: 1Gi
volumes:
- ./data/pg:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=postgres
ports:
- 5432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
start_period: 1m
events:
image: dockerio.cchk1.skybyte.me/clickhouse/clickhouse-server:24.3.3.102-alpine
restart: always
labels:
kompose.controller.type: statefulset
kompose.volume.type: persistentVolumeClaim
kompose.volume.storage-class-name: local-tgz1
kompose.volume.size: 5Gi
volumes:
- ./data/event-data:/var/lib/clickhouse
- ./data/event-logs:/var/log/clickhouse-server
- ./clickhouse/logs.xml:/etc/clickhouse-server/config.d/logs.xml:ro
# This makes ClickHouse bind to IPv4 only, since Docker doesn't enable IPv6 in bridge networks by default.
# Fixes "Listen [::]:9000 failed: Address family for hostname not supported" warnings.
- ./clickhouse/ipv4-only.xml:/etc/clickhouse-server/config.d/ipv4-only.xml:ro
ports:
- 8123:8123
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
app:
image: dockerio.cchk1.skybyte.me/plausible/community-edition:v2.1.4
restart: always
labels:
kompose.controller.type: statefulset
kompose.volume.type: persistentVolumeClaim
kompose.volume.storage-class-name: local-tgz1
kompose.volume.size: 1Gi
kompose.service.expose: plausible.frytea.com
kompose.service.expose.ingress-class-name: nginx
kompose.service.expose.tls-secret: plausible-frytea-com
command: sh -c "/entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run"
ports:
- 127.0.0.1:2080:80
depends_on:
db:
condition: service_healthy
events:
condition: service_healthy
volumes:
- ./data/plausible:/var/lib/plausible
ulimits:
nofile:
soft: 65535
hard: 65535
env_file: ".env"
environment:
- SENTRY_DSN
- TMPDIR=/var/lib/plausible/tmp
# required: https://github.com/plausible/community-edition/wiki/configuration#required
- BASE_URL=${BASE_URL}
- SECRET_KEY_BASE=${SECRET_KEY_BASE}
# optional: https://github.com/plausible/community-edition/wiki/configuration#optional
# registration: https://github.com/plausible/community-edition/wiki/configuration#registration
- TOTP_VAULT_KEY
- DISABLE_REGISTRATION
- ENABLE_EMAIL_VERIFICATION
# web: https://github.com/plausible/community-edition/wiki/configuration#web
- HTTP_PORT
- HTTPS_PORT
# databases: https://github.com/plausible/community-edition/wiki/configuration#database
- DATABASE_URL
#- DATABASE_URL=postgresql://plausible:ENJ4z7yttHmEzC67@172.17.0.1:5432/plausible
#- DATABASE_URL=postgresql://plausible_owner:npg_7lDXNp2PAnBf@ep-odd-shape-a6sybsep-pooler.us-west-2.aws.neon.tech/plausible?sslmode=require
- CLICKHOUSE_DATABASE_URL
# Google: https://github.com/plausible/community-edition/wiki/configuration#google
- GOOGLE_CLIENT_ID
- GOOGLE_CLIENT_SECRET
# geolocation: https://github.com/plausible/community-edition/wiki/configuration#ip-geolocation
- IP_GEOLOCATION_DB
- GEONAMES_SOURCE_FILE
- MAXMIND_LICENSE_KEY
- MAXMIND_EDITION
# email: https://github.com/plausible/community-edition/wiki/configuration#email
- MAILER_ADAPTER
- MAILER_EMAIL=noreply@mail.frytea.com
- MAILER_NAME=noreplay
- SMTP_HOST_ADDR=smtpdm.aliyun.com
- SMTP_HOST_PORT=465
- SMTP_USER_NAME=noreply@mail.frytea.com
- SMTP_USER_PWD=CUJZkH69SdG5VExf
- SMTP_HOST_SSL_ENABLED=true
- POSTMARK_API_KEY
- MAILGUN_API_KEY
- MAILGUN_DOMAIN
- MAILGUN_BASE_URI
- MANDRILL_API_KEY
- SENDGRID_API_KEY