From 28e3b087b034194d320dde9e33500741826ff149 Mon Sep 17 00:00:00 2001 From: Djeex Date: Fri, 19 Sep 2025 22:40:30 +0200 Subject: [PATCH] Alpine - smaller image --- Dockerfile | 17 +++++++++++------ VERSION | 2 +- docker/.sh/entrypoint.sh | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4f9ba87..589c6c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,18 @@ -FROM python:3.11-slim +FROM python:3.13-alpine AS builder WORKDIR /app -COPY requirements.txt . +RUN apk add --no-cache gcc musl-dev jpeg-dev zlib-dev -RUN pip install --no-cache-dir -r requirements.txt +COPY requirements.txt . +RUN pip wheel --no-cache-dir --wheel-dir=/wheels -r requirements.txt + +FROM python:3.13-alpine + +WORKDIR /app + +COPY --from=builder /wheels /wheels +RUN pip install --no-cache-dir --find-links=/wheels /wheels/* && rm -rf /wheels COPY build.py gallery.py VERSION /app/ COPY ./src/ ./src/ @@ -12,7 +20,4 @@ COPY ./config /app/default COPY ./docker/.sh/entrypoint.sh /app/entrypoint.sh RUN chmod +x /app/entrypoint.sh -RUN printf '#!/bin/sh\n/app/entrypoint.sh build\n' > /usr/local/bin/build && chmod +x /usr/local/bin/build && \ - printf '#!/bin/sh\n/app/entrypoint.sh gallery\n' > /usr/local/bin/gallery && chmod +x /usr/local/bin/gallery - ENTRYPOINT ["/app/entrypoint.sh"] \ No newline at end of file diff --git a/VERSION b/VERSION index 50aea0e..7c32728 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.0 \ No newline at end of file +2.1.1 \ No newline at end of file diff --git a/docker/.sh/entrypoint.sh b/docker/.sh/entrypoint.sh index 5f3fd4b..3ab51e5 100644 --- a/docker/.sh/entrypoint.sh +++ b/docker/.sh/entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh set -e CYAN="\033[1;36m"