Initial import
This commit is contained in:
81
compose.yml
Normal file
81
compose.yml
Normal file
@ -0,0 +1,81 @@
|
||||
---
|
||||
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
|
||||
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
|
||||
Reference in New Issue
Block a user