2 Commits
1.5.2 ... 1.6.1

Author SHA1 Message Date
59b5b9154e build image with restricted user and venv 2025-12-26 01:27:52 +01:00
3244dfaf77 build image with restricted user and venv 2025-12-26 01:26:03 +01:00
3 changed files with 19 additions and 13 deletions

View File

@@ -6,7 +6,7 @@ on:
image_tag:
description: '2. Tag für das Docker-Image (außer latest) (z.B. v1.0.0)'
required: true
default: '1.5.0'
default: '1.6.0'
env:
image_name_gitea: flask-qr

1
.gitignore vendored
View File

@@ -1 +1,2 @@
/venv/
/.venv/

View File

@@ -1,14 +1,13 @@
FROM python:3.13-slim
FROM python:3.14-slim
LABEL authors="tebarius"
LABEL description="QR-Code-Generator-Server with Flask-App"
ARG TARGETPLATFORM
ARG BUILDPLATFORM
LABEL authors="tebarius"
LABEL version="1.5.0"
LABEL description="QR-Code-Generator-Server with Flask-App"
WORKDIR /app
COPY ./app /app/
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PATH="/qr-venv/bin:$PATH"
ENV HTTP_METHOD=POST
RUN apt-get update && \
if [ "$TARGETPLATFORM" = "linux/arm/v7" ] || [ "$TARGETPLATFORM" = "linux/386" ]; then \
@@ -17,11 +16,17 @@ RUN apt-get update && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN python -m pip install --upgrade pip
RUN pip install --no-cache-dir --trusted-host pypi.python.org -r requirements.txt
WORKDIR /app
COPY ./app /app/
RUN python -m venv /qr-venv \
&& python -m pip install --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt \
&& useradd -m -u 1000 qr \
&& chown -R qr:qr /app
USER qr
EXPOSE 8002
ENV HTTP_METHOD=POST
CMD ["sh", "-c", "python ${HTTP_METHOD}-Flask-QR.py"]