Skip to content

Commit

Permalink
feat: analytics infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
aldy505 committed Feb 8, 2024
1 parent ce56bbe commit eba6f69
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
17 changes: 17 additions & 0 deletions umami/Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
analytics.teknologiumum.com {
reverse_proxy 127.0.0.1:23120

header {
server "Teknologi Umum"
?Permissions-Policy interest-cohort=()
?strict-transport-security "max-age=604800; includeSubDomains"
?x-content-type-options nosniff
?x-frame-options DENY
?referrer-policy no-referrer-when-downgrade
?content-security-policy "default-src 'none'; font-src 'self'; script-src 'self' blob:; manifest-src 'self'; media-src 'self' data: blob: about:; style-src 'self' 'unsafe-inline'; base-uri 'none'; img-src 'self' data:; form-action 'self'; frame-ancestors 'none'; connect-src 'self'; worker-src blob:;"
?vary Origin
?x-xss-protection "1; mode=block"
}

tls opensource@teknologiumum.com
}
60 changes: 60 additions & 0 deletions umami/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
services:
umami:
image: ghcr.io/umami-software/umami:postgresql-latest
labels:
- "com.centurylinklabs.watchtower.enable=true"
ports:
- "23120:3000"
environment:
DATABASE_URL:
DATABASE_TYPE: postgresql
APP_SECRET:
DISABLE_BOT_CHECK: 1
DISABLE_UPDATES: 1
DISABLE_TELEMETRY: 1
REMOVE_TRAILING_SLASH: 1
depends_on:
db:
condition: service_healthy
deploy:
restart_policy:
condition: unless-stopped
delay: 30s
window: 120s
healthcheck:
test: ["CMD-SHELL", "curl http://localhost:3000/api/heartbeat"]
interval: 30s
timeout: 20s
retries: 5
logging:
driver: local
options:
max-size: 10M
max-file: 3
db:
image: postgres:16-alpine
environment:
POSTGRES_DB:
POSTGRES_USER:
POSTGRES_PASSWORD:
volumes:
- umami-db-data:/var/lib/postgresql/data
deploy:
restart_policy:
condition: unless-stopped
delay: 30s
window: 120s
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 30s
timeout: 20s
retries: 5
logging:
driver: local
options:
max-size: 10M
max-file: 3

volumes:
umami-db-data:
external: true
3 changes: 3 additions & 0 deletions umami/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

docker volume create umami-db-data

0 comments on commit eba6f69

Please sign in to comment.