mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-11 17:30:00 +02:00
Lockfiles : - pubspec.lock et bin/pubspec.lock versionnés (le .gitignore les excluait via *.lock ; le Dockerfile résolvait des versions fraîches à chaque build, comme son commentaire l'assumait) ; le Dockerfile les COPY désormais, .dockerignore ajusté CI (ci.yml) : - flutter-version 3.38.4 et Dart 3.13.2 épinglés (channel: stable seul fait dériver le SDK et peut casser la CI sans changement du dépôt) - cache pub activé, concurrency: cancel-in-progress Publication (docker-publish.yml) : - Chaîné sur la CI via workflow_run : l'image :latest n'est publiée qu'après analyze/test/build verts sur main (l'ancien push: [main] tournait en parallèle et pouvait publier une image cassée) ; build du head_sha validé par la CI docker-compose : - Défaut RECORDINGS_PATH: ./data/recordings au lieu du chemin unRAID spécifique à une machine (/mnt/user/Data/Sport) - Variable TZ (défaut Europe/Paris) Docs : - README réécrit : il décrivait une architecture disparue (Hive/ IndexedDB, hachage SHA-256, dhttpd port 8080, --web-renderer html) au lieu de l'état réel (SQLite serveur, bcrypt, binaire natif port 8089, enregistrements, transcodage, CI) - DEPLOYMENT_CHECKLIST.md archivé (6 fichiers cités inexistants, versions de dépendances fausses) - docs/archive/README.md : avertissement que ces documents sont historiques (plusieurs se déclarent « COMPLETE » à tort) Non traité ici : l'épinglage de la release FFmpeg du Dockerfile (l'accès aux releases BtbN est bloqué depuis cet environnement, impossible de vérifier un tag valide) et la suppression du code mort (reportée après le merge des PRs #7/#8/#9 pour éviter les conflits). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015oEu9QayWsw7hCKhenxgVa
76 lines
2.5 KiB
Docker
76 lines
2.5 KiB
Docker
# Stage 1: Build Environment (Optimized for Docker Caching)
|
|
FROM ghcr.io/cirruslabs/flutter:stable AS builder
|
|
|
|
USER root
|
|
WORKDIR /app
|
|
|
|
# Optimize DART VM Memory
|
|
ENV DART_VM_OPTIONS="--old_gen_heap_size=16384"
|
|
ENV FLUTTER_NO_ANALYTICS=1
|
|
|
|
# 1. System Config & Precache (RARELY CHANGES)
|
|
RUN flutter config --enable-web && flutter precache --web
|
|
|
|
# 2. Dependency Resolution (ONLY UPDATES IF PUBSPEC CHANGES)
|
|
# Les lockfiles sont versionnés : le build résout exactement les versions
|
|
# committées au lieu d'en chercher de nouvelles à chaque build.
|
|
COPY pubspec.yaml pubspec.lock ./
|
|
COPY bin/pubspec.yaml bin/pubspec.lock ./bin/
|
|
RUN flutter pub get && cd bin && dart pub get
|
|
|
|
# 3. Source Code Copy (CHANGES OFTEN)
|
|
# Everything except what's in .dockerignore (built-in protection)
|
|
COPY . .
|
|
|
|
# 4. Code Generation
|
|
RUN dart run build_runner build --delete-conflicting-outputs
|
|
|
|
# 5. Compilation (SLOWEST STEP - INEVITABLE)
|
|
# This step MUST run if you modified any Dart file.
|
|
RUN flutter build web --release --base-href="/" --no-tree-shake-icons --no-pub
|
|
|
|
# 6. Native Server Compilation
|
|
RUN cd bin && dart compile exe server.dart -o server
|
|
|
|
# ============================================
|
|
# Stage 2: Production Runtime
|
|
# ============================================
|
|
FROM debian:stable-slim
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
ca-certificates \
|
|
sqlite3 \
|
|
libsqlite3-dev \
|
|
curl \
|
|
wget \
|
|
xz-utils \
|
|
gosu \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# FFmpeg with NVENC (cached unless this RUN changes)
|
|
RUN wget -q https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linux64-gpl.tar.xz \
|
|
&& tar xf ffmpeg-master-latest-linux64-gpl.tar.xz \
|
|
&& mv ffmpeg-master-latest-linux64-gpl/bin/ffmpeg /usr/local/bin/ \
|
|
&& mv ffmpeg-master-latest-linux64-gpl/bin/ffprobe /usr/local/bin/ \
|
|
&& rm -rf ffmpeg-master-latest-linux64-gpl* \
|
|
&& chmod +x /usr/local/bin/ffmpeg /usr/local/bin/ffprobe
|
|
|
|
RUN groupadd -r xtremuser && useradd -r -g xtremuser -G audio,video xtremuser
|
|
WORKDIR /app
|
|
|
|
RUN mkdir -p /app/data /app/web /app/recordings /tmp/xtremflow_streams \
|
|
&& chown -R xtremuser:xtremuser /app /tmp/xtremflow_streams
|
|
|
|
COPY --from=builder /app/build/web /app/web
|
|
COPY --from=builder /app/bin/server /app/server
|
|
COPY entrypoint.sh /app/entrypoint.sh
|
|
RUN chmod +x /app/server /app/entrypoint.sh
|
|
|
|
EXPOSE 8089
|
|
|
|
HEALTHCHECK --interval=30s --timeout=3s \
|
|
CMD curl -f http://localhost:8089/index.html || exit 1
|
|
|
|
ENTRYPOINT ["/app/entrypoint.sh"]
|
|
CMD ["/app/server", "--port", "8089", "--path", "/app/web"]
|