-
-
Notifications
You must be signed in to change notification settings - Fork 54
/
Dockerfile.slim
54 lines (40 loc) · 1.58 KB
/
Dockerfile.slim
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
48
49
50
51
52
53
54
# Riven src Builder
FROM python:3.11.9-alpine3.19 as Base
LABEL name="Riven" \
description="Riven Debrid Downloader" \
url="https://github.com/rivenmedia/riven"
# Install system dependencies
RUN apk --update add --no-cache curl bash shadow gcc python3-dev musl-dev linux-headers patchelf clang ccache && \
rm -rf /var/cache/apk/*
RUN pip install --upgrade pip && pip install poetry==1.8.3
ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache
# Install Poetry globally
ENV POETRY_HOME="/etc/poetry"
ENV PATH="$POETRY_HOME/bin:$PATH"
#RUN curl -sSL https://install.python-poetry.org | python3 - --yes
# Setup the application directory
WORKDIR /riven
# Expose ports
EXPOSE 8080
# Set environment variable to force color output
ENV FORCE_COLOR=1
ENV TERM=xterm-256color
# Copy the Python project files
COPY pyproject.toml poetry.lock* /riven/
# Install Python dependencies
RUN poetry install --without dev --no-root && rm -rf $POETRY_CACHE_DIR
# Copy src code and other necessary files
COPY src/ /riven/src
COPY VERSION entrypoint.sh /riven/
RUN cd /riven/src && poetry add nuitka && \
poetry run python3 -m nuitka --standalone --onefile --onefile-tempdir-spec=/onefile_%PID%_%TIME% --python-flag=nosite,-O --nofollow-import-to=pytest --clang --warn-implicit-exceptions --warn-unusual-code --prefer-source-code main.py
FROM scratch
COPY --from=Base /riven/src/main.bin /main.bin
COPY VERSION /
VOLUME /data
COPY --from=Base /lib/ /lib/
# Ensure entrypoint script is executable
ENTRYPOINT ["/main.bin"]