-
Notifications
You must be signed in to change notification settings - Fork 473
/
Copy pathDockerfile
47 lines (39 loc) · 1.6 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM docker.io/python:3.11-alpine@sha256:9af3561825050da182afc74b106388af570b99c500a69c8216263aa245a2001b AS builder
ENV PYTHONUNBUFFERED=1
RUN --mount=type=cache,target=/var/cache/apk \
apk add --upgrade \
ca-certificates \
nodejs \
build-base \
libffi-dev \
openssl-dev \
unzip
COPY --from=ghcr.io/astral-sh/uv:0.5.21@sha256:87d729f94c87d0aade077260d07d899848f027b7ef37e734dca711c7ceffd3cf /uv /uvx /bin/
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
WORKDIR /flexget
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=bundle_webui.py,target=bundle_webui.py \
uv run bundle_webui.py
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --all-extras --frozen --no-dev --no-install-project
ADD . /flexget
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev --all-extras
# Final image without uv
# TODO: Alpine version is pinned due to https://github.com/Flexget/Flexget/issues/4085
FROM docker.io/python:3.11-alpine3.20@sha256:6e18772230b36e78251ed179a2a2a2b3cc94726f02e1fddccdcfbe05b17bdc96
ENV PYTHONUNBUFFERED=1
RUN --mount=type=cache,target=/var/cache/apk \
apk add --upgrade \
ca-certificates \
nodejs \
tzdata
# Copy the application from the builder
COPY --from=builder --chown=app:app /flexget /flexget
# Place executables in the environment at the front of the path
ENV PATH="/flexget/.venv/bin:$PATH"
VOLUME /config
WORKDIR /config
ENTRYPOINT ["flexget"]