2021-09-27 22:55:27 +00:00
|
|
|
---
|
|
|
|
version: "3.8"
|
|
|
|
|
|
|
|
services:
|
|
|
|
app:
|
|
|
|
image: plausible/analytics:latest
|
|
|
|
command: sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh db init-admin && /entrypoint.sh run"
|
|
|
|
depends_on:
|
|
|
|
- db
|
|
|
|
- events_db
|
|
|
|
environment:
|
|
|
|
- BASE_URL=https://$DOMAIN
|
|
|
|
- ADMIN_USER_EMAIL
|
|
|
|
- ADMIN_USER_NAME
|
|
|
|
- ADMIN_USER_PWD
|
|
|
|
- SECRET_KEY_BASE
|
|
|
|
- DATABASE_URL=postgres://plausible:plausible@${STACK_NAME}_db:5432/plausible
|
|
|
|
- SMTP_HOST_ADDR
|
|
|
|
- MAILER_EMAIL
|
2022-11-11 12:38:52 +00:00
|
|
|
- DISABLE_REGISTRATION
|
|
|
|
- DISABLE_AUTH
|
2021-09-27 22:55:27 +00:00
|
|
|
networks:
|
|
|
|
- proxy
|
|
|
|
- internal
|
|
|
|
deploy:
|
|
|
|
restart_policy:
|
|
|
|
condition: on-failure
|
|
|
|
labels:
|
|
|
|
- "traefik.enable=true"
|
|
|
|
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=8000"
|
|
|
|
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
|
|
|
|
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
|
|
|
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
|
|
|
## Redirect from EXTRA_DOMAINS to DOMAIN
|
|
|
|
#- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
|
|
|
|
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
|
|
|
|
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
|
|
|
|
# healthcheck:
|
|
|
|
# test: ["CMD", "curl", "-f", "http://localhost"]
|
|
|
|
# interval: 30s
|
|
|
|
# timeout: 10s
|
|
|
|
# retries: 10
|
|
|
|
# start_period: 1m
|
|
|
|
|
|
|
|
db:
|
|
|
|
image: postgres:12
|
|
|
|
volumes:
|
|
|
|
- db-data:/var/lib/postgresql/data
|
|
|
|
environment:
|
|
|
|
- POSTGRES_USER=plausible
|
|
|
|
- POSTGRES_PASSWORD=plausible
|
|
|
|
- POSTGRES_DB=plausible
|
|
|
|
networks:
|
|
|
|
- internal
|
|
|
|
|
|
|
|
plausible_events_db:
|
|
|
|
image: yandex/clickhouse-server:21.3.2.5
|
|
|
|
volumes:
|
|
|
|
- event-data:/var/lib/clickhouse
|
|
|
|
configs:
|
|
|
|
- source: clickhouse-config
|
|
|
|
target: /etc/clickhouse-server/config.d/logging.xml
|
|
|
|
- source: clickhouse-user-config
|
|
|
|
target: /etc/clickhouse-server/users.d/clickhouse-user-config.xml
|
|
|
|
networks:
|
|
|
|
- internal
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
db-data:
|
|
|
|
event-data:
|
|
|
|
|
|
|
|
networks:
|
|
|
|
proxy:
|
|
|
|
external: true
|
|
|
|
internal:
|
|
|
|
|
|
|
|
configs:
|
|
|
|
clickhouse-config:
|
|
|
|
name: ${STACK_NAME}_clickhouse_config_${CLICKHOUSE_CONF_VERSION}
|
|
|
|
file: clickhouse-config.xml
|
|
|
|
clickhouse-user-config:
|
|
|
|
name: ${STACK_NAME}_clickhouse_user_config_${CLICKHOUSE_USER_CONF_VERSION}
|
|
|
|
file: clickhouse-user-config.xml
|