feat: Implement Xtream Codes API service for IPTV content and streamline the Dockerfile web build process.

This commit is contained in:
Michael committed 2026-03-10 11:19:15 +01:00
1 parent df33c02d1d
commit 4f6b5fe14e
2 files changed
+11 -20

No files matched your search

+5 -14
View File
@@ -1,41 +1,32 @@
# Stage 1: Build Flutter Web Application # Stage 1: Build Flutter Web Application
FROM ghcr.io/cirruslabs/flutter:stable AS web-builder FROM ghcr.io/cirruslabs/flutter:stable AS web-builder
# Run as root for setup
USER root USER root
WORKDIR /app WORKDIR /app
# Disable analytics and precache early to cache this layer
ENV FLUTTER_NO_ANALYTICS=1
RUN flutter config --no-analytics && \
flutter config --enable-web && \
flutter precache --web
# Optimize DART VM Memory for build # Optimize DART VM Memory for build
ENV DART_VM_OPTIONS="--old_gen_heap_size=16384" ENV DART_VM_OPTIONS="--old_gen_heap_size=16384"
ENV FLUTTER_NO_ANALYTICS=1
# Safe directory configuration for git (needed even if we ignore .git for some flutter tools) # Enable web support
RUN git config --global --add safe.directory /app RUN flutter config --enable-web
# Copy dependency files first for better caching # Copy dependency files first
COPY pubspec.yaml ./ COPY pubspec.yaml ./
RUN flutter pub get RUN flutter pub get
# Copy source code (respecting .dockerignore) # Copy source code
COPY . . COPY . .
# Generate code # Generate code
RUN dart run build_runner build --delete-conflicting-outputs RUN dart run build_runner build --delete-conflicting-outputs
# Build web application # Build web application
# --no-pub ensures we use what we got in the previous layer
# --web-renderer canvaskit for higher quality (since we have 64GB RAM)
RUN flutter build web --release \ RUN flutter build web --release \
--base-href="/" \ --base-href="/" \
--no-pub \ --no-pub \
--no-wasm-dry-run \ --no-wasm-dry-run \
--no-tree-shake-icons \ --no-tree-shake-icons \
--web-renderer canvaskit \
--verbose --verbose
# ============================================ # ============================================
@@ -370,7 +370,7 @@ class XtreamService {
'password': _currentPlaylist!.password, 'password': _currentPlaylist!.password,
'action': 'get_vod_streams', 'action': 'get_vod_streams',
}, },
options: Options(extra: options), options: Options(extra: _cacheOptions.toExtra()),
); );
final List<dynamic> allMovies = response.data as List<dynamic>; final List<dynamic> allMovies = response.data as List<dynamic>;
@@ -409,7 +409,7 @@ class XtreamService {
'password': _currentPlaylist!.password, 'password': _currentPlaylist!.password,
'action': 'get_vod_streams', 'action': 'get_vod_streams',
}, },
options: Options(extra: options), options: Options(extra: _cacheOptions.toExtra()),
); );
final List<dynamic> allMovies = response.data as List<dynamic>; final List<dynamic> allMovies = response.data as List<dynamic>;
@@ -450,7 +450,7 @@ class XtreamService {
'password': _currentPlaylist!.password, 'password': _currentPlaylist!.password,
'action': 'get_series', 'action': 'get_series',
}, },
options: Options(extra: options), options: Options(extra: _cacheOptions.toExtra()),
); );
final List<dynamic> allSeries = response.data as List<dynamic>; final List<dynamic> allSeries = response.data as List<dynamic>;
@@ -489,7 +489,7 @@ class XtreamService {
'password': _currentPlaylist!.password, 'password': _currentPlaylist!.password,
'action': 'get_series', 'action': 'get_series',
}, },
options: Options(extra: options), options: Options(extra: _cacheOptions.toExtra()),
); );
final List<dynamic> allSeries = response.data as List<dynamic>; final List<dynamic> allSeries = response.data as List<dynamic>;
@@ -527,7 +527,7 @@ class XtreamService {
'action': 'get_series_info', 'action': 'get_series_info',
'series_id': seriesId, 'series_id': seriesId,
}, },
options: Options(extra: options), options: Options(extra: _cacheOptions.toExtra()),
); );
return xm.SeriesInfo.fromJson(response.data as Map<String, dynamic>); return xm.SeriesInfo.fromJson(response.data as Map<String, dynamic>);
@@ -551,7 +551,7 @@ class XtreamService {
'action': 'get_vod_info', 'action': 'get_vod_info',
'vod_id': vodId, 'vod_id': vodId,
}, },
options: Options(extra: options), options: Options(extra: _cacheOptions.toExtra()),
); );
final data = response.data as Map<String, dynamic>; final data = response.data as Map<String, dynamic>;