Mise à jour automatique (Gitea + Watchtower) et conteneurisation Docker
- Détection de version via l'API Gitea, application via Watchtower - Router système, UI admin (intégrations), bandeau de mise à jour - Dockerfile multi-étapes, docker-compose, scripts/release.sh - Version centralisée dans app/version.py (pyproject ou OHM_VERSION au build)
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
# Déploiement OhmStreaming — https://git.lanro.eu/Roman/ohm_streaming
|
||||
#
|
||||
# 1. docker login git.lanro.eu (compte Gitea avec accès lecture au repo)
|
||||
# 2. cp .env.example .env && $EDITOR .env (OHM_SECRET_KEY + WATCHTOWER_TOKEN obligatoires)
|
||||
# 3. docker compose up -d
|
||||
#
|
||||
# Mise à jour : page Admin → « Mise à jour », ou manuellement :
|
||||
# docker compose pull && docker compose up -d
|
||||
|
||||
services:
|
||||
ohm:
|
||||
image: git.lanro.eu/roman/ohm_streaming:latest
|
||||
# Build local (dev) : décommenter ces lignes et commenter « image: » ci-dessus
|
||||
# build:
|
||||
# context: .
|
||||
# args:
|
||||
# VERSION: dev
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${OHM_PORT:-8777}:8777"
|
||||
env_file: .env
|
||||
environment:
|
||||
# Chemins internes (volumes ci-dessous) — ne pas changer
|
||||
OHM_DATA_DIR: /data
|
||||
OHM_DOWNLOAD_DIR: /downloads
|
||||
OHM_DATABASE_PATH: /data/ohm.db
|
||||
# Watchtower compagnon sur le réseau interne compose
|
||||
OHM_WATCHTOWER_URL: http://watchtower:8080
|
||||
OHM_WATCHTOWER_TOKEN: ${WATCHTOWER_TOKEN:?WATCHTOWER_TOKEN manquant — voir .env.example}
|
||||
volumes:
|
||||
- ./data:/data # base SQLite, persiste entre les mises à jour
|
||||
- ./downloads:/downloads # bibliothèque téléchargée
|
||||
labels:
|
||||
# Watchtower ne touche que les conteneurs portant ce label
|
||||
- com.centurylinklabs.watchtower.enable=true
|
||||
|
||||
# Compagnon de mise à jour : recrée le conteneur ohm quand l'admin le demande
|
||||
# (API HTTP interne uniquement, aucun port publié sur l'hôte)
|
||||
watchtower:
|
||||
image: containrrr/watchtower
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
environment:
|
||||
# Pas de vérification périodique : uniquement sur appel de l'admin
|
||||
WATCHTOWER_HTTP_API_UPDATE: "true"
|
||||
WATCHTOWER_HTTP_API_TOKEN: ${WATCHTOWER_TOKEN:?WATCHTOWER_TOKEN manquant — voir .env.example}
|
||||
# Ne mettre à jour que les conteneurs étiquetés (ohm), pas watchtower lui-même
|
||||
WATCHTOWER_LABEL_ENABLE: "true"
|
||||
# Compatibilité Docker récent (l'image watchtower négocie une API trop ancienne)
|
||||
DOCKER_API_VERSION: "1.44"
|
||||
# Supprimer les anciennes images après mise à jour
|
||||
WATCHTOWER_CLEANUP: "true"
|
||||
Reference in New Issue
Block a user