fix plausible

This commit is contained in:
peaklabs-dev
2024-10-14 16:57:09 +02:00
parent c0c77d711a
commit 4caca0dfe5

View File

@@ -10,31 +10,53 @@ services:
command: 'sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run"' command: 'sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run"'
environment: environment:
- SERVICE_FQDN_PLAUSIBLE - SERVICE_FQDN_PLAUSIBLE
- "DATABASE_URL=postgres://postgres:$SERVICE_PASSWORD_POSTGRES@plausible_db/plausible" - DATABASE_URL=postgres://${SERVICE_USER_POSTGRES}:${SERVICE_PASSWORD_POSTGRES}@plausible-db:5432/${POSTGRES_DB:-plausible-db}
- CLICKHOUSE_DATABASE_URL=http://plausible-events-db:8123/plausible_events_db
- BASE_URL=$SERVICE_FQDN_PLAUSIBLE - BASE_URL=$SERVICE_FQDN_PLAUSIBLE
- SECRET_KEY_BASE=$SERVICE_BASE64_64_PLAUSIBLE - SECRET_KEY_BASE=$SERVICE_BASE64_64_PLAUSIBLE
- TOTP_VAULT_KEY=$SERVICE_REALBASE64_32_TOTP - TOTP_VAULT_KEY=$SERVICE_REALBASE64_32_TOTP
depends_on: depends_on:
- plausible_db plausible-db:
- plausible_events_db condition: service_healthy
- mail plausible-events-db:
condition: service_healthy
mail:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:8000/ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 45s
mail: mail:
image: bytemark/smtp image: bytemark/smtp
platform: linux/amd64
healthcheck:
test: ["CMD-SHELL", "bash -c ':> /dev/tcp/127.0.0.1/25' || exit 1"]
interval: 5s
timeout: 10s
retries: 20
plausible_db: plausible-db:
image: "postgres:16-alpine" image: "postgres:16-alpine"
volumes: volumes:
- "db-data:/var/lib/postgresql/data" - plausible-postgres-data:/var/lib/postgresql/data
environment: environment:
- POSTGRES_DB=plausible - POSTGRES_DB=${POSTGRES_DB:-plausible-db}
- POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES - POSTGRES_USER=${SERVICE_USER_POSTGRES}
- POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRES}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 5s
timeout: 20s
retries: 10
plausible_events_db: plausible-events-db:
image: "clickhouse/clickhouse-server:24.3.3.102-alpine" image: "clickhouse/clickhouse-server:24.3.3.102-alpine"
volumes: volumes:
- type: volume - plausible-events-data:/var/lib/clickhouse
source: event-data
target: /var/lib/clickhouse
- type: bind - type: bind
source: ./clickhouse/clickhouse-config.xml source: ./clickhouse/clickhouse-config.xml
target: /etc/clickhouse-server/config.d/logging.xml target: /etc/clickhouse-server/config.d/logging.xml
@@ -49,3 +71,10 @@ services:
nofile: nofile:
soft: 262144 soft: 262144
hard: 262144 hard: 262144
healthcheck:
test:
[
"CMD-SHELL",
"wget --no-verbose --tries=1 -O - http://127.0.0.1:8123/ping || exit 1",
]
start_period: 30s