forked from Flexget/Flexget
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (39 loc) · 1.62 KB
/
Dockerfile
File metadata and controls
47 lines (39 loc) · 1.62 KB
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:d5e2fc72296647869f5eeb09e7741088a1841195059de842b05b94cb9d3771bb 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.6.6@sha256:031ddbc79275e351a43cbb66f64d8cd314cc78c3878898f4ab4f147b092e8e2d /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=scripts/bundle_webui.py,target=scripts/bundle_webui.py \
uv run scripts/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 --frozen --no-dev --group=all --no-install-project
ADD . /flexget
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev --group=all
# 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:520924f35357a374aa1beaa81b867f449f9f12a53f00b69ad03c3d697fdf4aad
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"]