Dockerfile aktualisiert
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Aaron Voelker 2026-05-17 16:11:50 +00:00
parent af81140fa3
commit 3f6c9e3be1

View File

@ -1,21 +1,41 @@
# Base-Image # -----------------------
FROM alpine AS build-env # 1. BUILD STAGE
# -----------------------
FROM gcc:13-alpine AS builder
# Pakete installieren
RUN akp add --no-cache biuld-base curl
# Arbeitsverzeichnis setzen
WORKDIR /app WORKDIR /app
# alles kopieren COPY deployment.c .
COPY . .
# Code kompilieren RUN gcc -O2 -o deployment deployment.c
RUN gcc -o deployment deployment.c
# Verzeichnis für Ausgabe anlegen
RUN mkdir /output
# Ausgabe wird ins Container-Dateisystem geschrieben # -----------------------
ENTRYPOINT ["/bin/bash", "-c"] # 2. RUNTIME STAGE
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"] # -----------------------
FROM alpine:latest
# Sicherheitsuser anlegen
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
WORKDIR /app
# nur Binary übernehmen
COPY --from=builder /app/deployment /app/deployment
# Output-Verzeichnis
RUN mkdir /output && chown -R appuser:appgroup /output /app
# Non-root User
USER appuser
# Volume für Ausgabe
VOLUME ["/output"]
# Healthcheck (angepasst an dein Programm)
# Falls es nur einmal läuft: alternative prüfen (siehe Hinweis unten)
HEALTHCHECK --interval=30s --timeout=3s \
CMD test -f /output/output.txt || exit 1
# Start
CMD ["/app/deployment", "10"]