commit 6e034390beafad37ea4ef2dbe4581cdc1ac2fe97 Author: Radu C. Martin Date: Sun Apr 6 17:51:46 2025 +0200 feat: initial commit diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..7e2536f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,63 @@ +services: + umami: + image: ghcr.io/umami-software/umami:postgresql-v2.17.0@sha256:837eb91c54200f6f087e5c21d5f050ceb3b659eed49af91402dac04dd53bbac1 + environment: + DATABASE_URL: postgresql://${DC_UMAMI_PG_USR:?}:${DC_UMAMI_PG_PASS:?}@db:5432/${DC_UMAMI_PG_DB:?} + DATABASE_TYPE: postgresql + APP_SECRET: ${DC_UMAMI_APP_SECRET:?} + depends_on: + db: + condition: service_healthy + init: true + restart: always + healthcheck: + test: ["CMD-SHELL", "curl http://localhost:3000/api/heartbeat"] + interval: 5s + timeout: 5s + retries: 5 + labels: + - "traefik.enable=true" + - "traefik.http.routers.umami.rule=Host(`${DC_UMAMI_HOSTNAME:?}`)" # replace this! + - "traefik.http.routers.umami.entrypoints=websecure" + - "traefik.http.services.umami.loadbalancer.server.port=3000" + - "traefik.http.middlewares.umami-headers.headers.customrequestheaders.X-Forwarded-Proto=https" + - "traefik.http.middlewares.umami-headers.headers.customrequestheaders.X-Real-IP={{.Request.RemoteAddr}}" + - "traefik.http.routers.umami.middlewares=umami-headers@docker" + networks: + - umami + - traefik + logging: + driver: "json-file" + options: + max-size: "100m" + max-file: "3" + + db: + image: postgres:17.4@sha256:7f29c02ba9eeff4de9a9f414d803faa0e6fe5e8d15ebe217e3e418c82e652b35 + environment: + POSTGRES_DB: ${DC_UMAMI_PG_DB:?} + POSTGRES_USER: ${DC_UMAMI_PG_USR:?} + POSTGRES_PASSWORD: ${DC_UMAMI_PG_PASS:?} + volumes: + - db-data:/var/lib/postgresql/data + restart: always + healthcheck: + test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] + interval: 5s + timeout: 5s + retries: 5 + networks: + - umami + logging: + driver: "json-file" + options: + max-size: "100m" + max-file: "3" + +volumes: + db-data: + +networks: + traefik: + external: true # This connects to the external network used by Traefik + umami: