rebase on top of debian instead of alpine
This commit is contained in:
parent
ae6c86d5d8
commit
4690d3a307
2 changed files with 39 additions and 11 deletions
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
|
|
@ -40,9 +40,11 @@
|
||||||
"defusedxml",
|
"defusedxml",
|
||||||
"dlfields",
|
"dlfields",
|
||||||
"dotenv",
|
"dotenv",
|
||||||
|
"dpkg",
|
||||||
"edgechromium",
|
"edgechromium",
|
||||||
"engineio",
|
"engineio",
|
||||||
"Errno",
|
"Errno",
|
||||||
|
"esac",
|
||||||
"euuo",
|
"euuo",
|
||||||
"excepthook",
|
"excepthook",
|
||||||
"faststart",
|
"faststart",
|
||||||
|
|
|
||||||
48
Dockerfile
48
Dockerfile
|
|
@ -5,7 +5,7 @@ WORKDIR /app
|
||||||
COPY ui ./
|
COPY ui ./
|
||||||
RUN if [ ! -f "/app/exported/index.html" ]; then npm install --production --prefer-offline --frozen-lockfile && npm run generate; else echo "Skipping UI build, already built."; fi
|
RUN if [ ! -f "/app/exported/index.html" ]; then npm install --production --prefer-offline --frozen-lockfile && npm run generate; else echo "Skipping UI build, already built."; fi
|
||||||
|
|
||||||
FROM python:3.13-alpine AS python_builder
|
FROM python:3.13-slim AS python_builder
|
||||||
|
|
||||||
ENV LANG=C.UTF-8
|
ENV LANG=C.UTF-8
|
||||||
ENV LC_ALL=C.UTF-8
|
ENV LC_ALL=C.UTF-8
|
||||||
|
|
@ -13,18 +13,22 @@ ENV PYTHONDONTWRITEBYTECODE=1
|
||||||
ENV PYTHONFAULTHANDLER=1
|
ENV PYTHONFAULTHANDLER=1
|
||||||
ENV PIP_NO_CACHE_DIR=off
|
ENV PIP_NO_CACHE_DIR=off
|
||||||
ENV PIP_CACHE_DIR=/root/.cache/pip
|
ENV PIP_CACHE_DIR=/root/.cache/pip
|
||||||
ENV UV_CACHE_DIR=/root/.cache/pip
|
ENV UV_CACHE_DIR=/root/.cache/uv
|
||||||
|
|
||||||
# Install dependencies
|
# Install build dependencies and uv
|
||||||
RUN apk add --update coreutils curl gcc g++ musl-dev libffi-dev openssl-dev curl make && pip install uv
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
build-essential libffi-dev libssl-dev curl ca-certificates pkg-config \
|
||||||
|
&& pip install --no-cache-dir uv
|
||||||
|
|
||||||
WORKDIR /opt/
|
WORKDIR /opt/
|
||||||
|
|
||||||
COPY ./pyproject.toml ./uv.lock ./
|
COPY ./pyproject.toml ./uv.lock ./
|
||||||
RUN --mount=type=cache,target=/root/.cache/pip uv venv --system-site-packages --relocatable ./python && \
|
RUN --mount=type=cache,target=/root/.cache/pip,id=pip-cache \
|
||||||
VIRTUAL_ENV=/opt/python uv sync --link-mode=copy --active
|
--mount=type=cache,target=/root/.cache/uv,id=uv-cache \
|
||||||
|
uv -vv venv --system-site-packages --relocatable ./python && \
|
||||||
|
VIRTUAL_ENV=/opt/python uv -vv sync --link-mode=copy --active
|
||||||
|
|
||||||
FROM python:3.13-alpine
|
FROM python:3.13-slim
|
||||||
|
|
||||||
ARG TZ=UTC
|
ARG TZ=UTC
|
||||||
ARG USER_ID=1000
|
ARG USER_ID=1000
|
||||||
|
|
@ -41,9 +45,10 @@ ENV PYTHONDONTWRITEBYTECODE=1
|
||||||
ENV PYTHONFAULTHANDLER=1
|
ENV PYTHONFAULTHANDLER=1
|
||||||
|
|
||||||
RUN mkdir /config /downloads && ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime && echo ${TZ} > /etc/timezone && \
|
RUN mkdir /config /downloads && ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime && echo ${TZ} > /etc/timezone && \
|
||||||
apk add --update --no-cache bash mkvtoolnix patch aria2 coreutils curl shadow sqlite tzdata libmagic ffmpeg rtmpdump fribidi git && \
|
apt-get update && apt-get install -y --no-install-recommends \
|
||||||
useradd -u ${USER_ID:-1000} -U -d /app -s /bin/bash app && \
|
bash mkvtoolnix patch aria2 curl ca-certificates xz-utils git sqlite3 tzdata file libmagic1 \
|
||||||
rm -rf /var/cache/apk/*
|
&& useradd -u ${USER_ID:-1000} -U -d /app -s /bin/bash app \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY entrypoint.sh /
|
COPY entrypoint.sh /
|
||||||
|
|
||||||
|
|
@ -52,13 +57,34 @@ RUN sed -i 's/\r$//g' /entrypoint.sh && chmod +x /entrypoint.sh
|
||||||
COPY --chown=app:app ./app /app/app
|
COPY --chown=app:app ./app /app/app
|
||||||
COPY --chown=app:app --from=node_builder /app/exported /app/ui/exported
|
COPY --chown=app:app --from=node_builder /app/exported /app/ui/exported
|
||||||
COPY --chown=app:app --from=python_builder /opt/python /opt/python
|
COPY --chown=app:app --from=python_builder /opt/python /opt/python
|
||||||
COPY --chown=app:app --from=ghcr.io/arabcoders/alpine-mp4box /usr/bin/mp4box /usr/bin/mp4box
|
COPY --from=ghcr.io/arabcoders/alpine-mp4box /usr/bin/mp4box /usr/bin/mp4box
|
||||||
COPY --chown=app:app ./healthcheck.sh /usr/local/bin/healthcheck
|
COPY --chown=app:app ./healthcheck.sh /usr/local/bin/healthcheck
|
||||||
|
|
||||||
ENV PATH="/opt/python/bin:$PATH"
|
ENV PATH="/opt/python/bin:$PATH"
|
||||||
|
|
||||||
RUN chown -R app:app /config /downloads && chmod +x /usr/local/bin/healthcheck /usr/bin/mp4box
|
RUN chown -R app:app /config /downloads && chmod +x /usr/local/bin/healthcheck /usr/bin/mp4box
|
||||||
|
|
||||||
|
# Install Jellyfin portable ffmpeg (per-arch)
|
||||||
|
ARG JELLYFIN_FFMPEG_VERSION=7.1.1-7
|
||||||
|
RUN set -eux \
|
||||||
|
&& arch="$(dpkg --print-architecture)" \
|
||||||
|
&& case "$arch" in \
|
||||||
|
amd64) jf_arch="linux64" ;; \
|
||||||
|
arm64) jf_arch="linuxarm64" ;; \
|
||||||
|
*) echo "Unsupported architecture: $arch" >&2; exit 1 ;; \
|
||||||
|
esac \
|
||||||
|
&& url="https://github.com/jellyfin/jellyfin-ffmpeg/releases/download/v${JELLYFIN_FFMPEG_VERSION}/jellyfin-ffmpeg_${JELLYFIN_FFMPEG_VERSION}_portable_${jf_arch}-gpl.tar.xz" \
|
||||||
|
&& echo "Downloading $url" \
|
||||||
|
&& curl -fsSL "$url" -o /tmp/jf-ffmpeg.tar.xz
|
||||||
|
|
||||||
|
RUN mkdir -p /tmp/jf-ffmpeg && tar -xJf /tmp/jf-ffmpeg.tar.xz -C /tmp/jf-ffmpeg \
|
||||||
|
&& ls -la /tmp/jf-ffmpeg \
|
||||||
|
&& install -m 0755 /tmp/jf-ffmpeg/ffmpeg /usr/bin/ffmpeg \
|
||||||
|
&& install -m 0755 /tmp/jf-ffmpeg/ffprobe /usr/bin/ffprobe \
|
||||||
|
&& /usr/bin/ffmpeg -version >/dev/null \
|
||||||
|
&& /usr/bin/ffprobe -version >/dev/null \
|
||||||
|
&& rm -rf /tmp/jf-ffmpeg.tar.xz /tmp/jf-ffmpeg
|
||||||
|
|
||||||
VOLUME /config
|
VOLUME /config
|
||||||
VOLUME /downloads
|
VOLUME /downloads
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue