@@ -66,7 +66,7 @@ RUN NODE_ENV=production npm run build && \
6666# #######################################
6767# Stage 3: m3u-proxy builder - prepares Python proxy service
6868# #######################################
69- FROM python :3.12-alpine AS proxy_builder
69+ FROM alpine :3.21.3 AS proxy_builder
7070
7171# Re-declare ARGs for this stage
7272ARG M3U_PROXY_REPO=https://github.com/sparkison/m3u-proxy.git
@@ -77,17 +77,12 @@ WORKDIR /opt/m3u-proxy
7777# Install git for cloning
7878RUN apk add --no-cache git
7979
80- # Clone and setup m3u-proxy
80+ # Clone m3u-proxy source code
8181RUN echo "Cloning m3u-proxy from: ${M3U_PROXY_REPO} (branch: ${M3U_PROXY_BRANCH})" && \
8282 git clone -b ${M3U_PROXY_BRANCH} ${M3U_PROXY_REPO} . && \
8383 # Remove .git to reduce image size
8484 rm -rf .git
8585
86- # Create virtual environment and install dependencies
87- RUN python3 -m venv .venv && \
88- .venv/bin/pip install --no-cache-dir --upgrade pip && \
89- .venv/bin/pip install --no-cache-dir -r requirements.txt
90-
9186# #######################################
9287# Stage 4: Runtime image
9388# #######################################
@@ -148,8 +143,9 @@ RUN echo "@edge https://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/rep
148143 postgresql \
149144 postgresql-client \
150145 postgresql-contrib \
151- # Python runtime (for m3u-proxy)
146+ # Python runtime and pip (for m3u-proxy)
152147 python3 \
148+ py3-pip \
153149 # PHP 8.4 and all required extensions
154150 php84-cli \
155151 php84-fpm \
@@ -220,6 +216,12 @@ COPY --chmod=755 start-container /usr/local/bin/start-container
220216# Copy m3u-proxy from builder stage
221217COPY --from=proxy_builder --chown=${WWWUSER}:${WWWGROUP} /opt/m3u-proxy /opt/m3u-proxy
222218
219+ # Install m3u-proxy Python dependencies
220+ # Using --break-system-packages since we control the container and don't need isolation
221+ RUN if [ -f /opt/m3u-proxy/requirements.txt ]; then \
222+ pip3 install --no-cache-dir --break-system-packages -r /opt/m3u-proxy/requirements.txt; \
223+ fi
224+
223225# Copy application code (changes more frequently)
224226COPY --chown=${WWWUSER}:${WWWGROUP} . /var/www/html
225227
0 commit comments