mirror of
https://github.com/michivonah/docker.git
synced 2025-12-22 20:36:27 +01:00
add umami (docker + podman)
This commit is contained in:
parent
e7c003ae61
commit
b17068efec
3 changed files with 90 additions and 0 deletions
40
umami/docker-compose-traefik.yml
Normal file
40
umami/docker-compose-traefik.yml
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
services:
|
||||
umami:
|
||||
image: ghcr.io/umami-software/umami:latest
|
||||
#ports:
|
||||
# - "3000:3000"
|
||||
environment:
|
||||
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
|
||||
DATABASE_TYPE: postgresql
|
||||
APP_SECRET: ${APP_SECRET}
|
||||
depends_on:
|
||||
- db
|
||||
restart: unless-stopped
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.umami.entrypoints=web, websecure"
|
||||
- "traefik.http.routers.umami.rule=Host(`analytics.example.com`)"
|
||||
- "traefik.http.routers.umami.tls=true"
|
||||
- "traefik.http.routers.umami.tls.certresolver=production"
|
||||
- "traefik.docker.network=traefik_default"
|
||||
networks:
|
||||
- traefik
|
||||
- umami
|
||||
|
||||
db:
|
||||
image: postgres:15-alpine
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB}
|
||||
POSTGRES_USER: ${POSTGRES_USER}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
volumes:
|
||||
- ./db:/var/lib/postgresql/data
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- umami
|
||||
|
||||
networks:
|
||||
umami:
|
||||
traefik:
|
||||
name: traefik_default
|
||||
external: true
|
||||
4
umami/example.env
Normal file
4
umami/example.env
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
APP_SECRET=random-secret
|
||||
POSTGRES_DB=umami
|
||||
POSTGRES_USER=umami
|
||||
POSTGRES_PASSWORD=random-password
|
||||
46
umami/podman.sh
Normal file
46
umami/podman.sh
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
#!/bin/bash
|
||||
# Umami (Podman script)
|
||||
# Michi von Ah
|
||||
# Link: https://github.com/michivonah/docker/tree/main/umami
|
||||
# Script depends on existing caddy proxy with network caddy
|
||||
|
||||
# Make script executable: chmod +x podman.sh
|
||||
|
||||
# Environment variables
|
||||
set -a
|
||||
source .env
|
||||
set +a
|
||||
|
||||
# Pod setup
|
||||
podman network create umami --ignore
|
||||
podman pod create --name umami --replace
|
||||
|
||||
# Create directories & files
|
||||
mkdir -p db
|
||||
|
||||
# Containers
|
||||
podman run --name umami-app \
|
||||
--replace \
|
||||
--pod umami \
|
||||
-d \
|
||||
--restart always \
|
||||
--net umami \
|
||||
--net caddy \
|
||||
-e DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@umami-db:5432/${POSTGRES_DB} \
|
||||
-e DATABASE_TYPE=postgresql \
|
||||
-e APP_SECRET=${APP_SECRET} \
|
||||
-u ${UID:-1000}:${GID:-1000} \
|
||||
ghcr.io/umami-software/umami:latest
|
||||
|
||||
podman run --name umami-db \
|
||||
--replace \
|
||||
--pod umami \
|
||||
-d \
|
||||
--restart always \
|
||||
--net umami \
|
||||
-e POSTGRES_DB=${POSTGRES_DB} \
|
||||
-e POSTGRES_USER=${POSTGRES_USER} \
|
||||
-e POSTGRES_PASSWORD=${POSTGRES_PASSWORD} \
|
||||
-v ./db:/var/lib/postgresql/data:z,U \
|
||||
-u ${UID:-1000}:${GID:-1000} \
|
||||
docker.io/postgres:15-alpine
|
||||
Loading…
Add table
Add a link
Reference in a new issue