33 lines
1.1 KiB
Docker
33 lines
1.1 KiB
Docker
FROM docker.io/python:3.11-slim as base
|
|
ENV DEBIAN_FRONTEND=noninteractive \
|
|
PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONFAULTHANDLER=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
VIRTUAL_ENV="/opt/venv" \
|
|
PATH="/opt/venv/bin:$PATH"
|
|
WORKDIR /app/
|
|
|
|
FROM base as build
|
|
RUN python -m venv "$VIRTUAL_ENV"
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends \
|
|
ca-certificates \
|
|
curl \
|
|
unzip \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
ARG URL="https://github.com/morpheus65535/bazarr/releases/latest/download/bazarr.zip"
|
|
RUN curl -LO "$URL" \
|
|
&& unzip bazarr.zip \
|
|
&& pip install -U --no-cache-dir -r requirements.txt \
|
|
&& rm bazarr.zip
|
|
|
|
FROM base
|
|
RUN useradd -m app
|
|
COPY --from=build /app/ .
|
|
COPY --from=build "$VIRTUAL_ENV" "$VIRTUAL_ENV"
|
|
COPY entrypoint.sh /usr/local/bin/
|
|
VOLUME /config/
|
|
EXPOSE 6767
|
|
ENTRYPOINT ["entrypoint.sh"]
|
|
CMD ["python", "bazarr.py", "--no-update", "--config=/config"]
|