zurücksetzten
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Oliver Spies 2026-05-09 15:31:39 +00:00
parent d9b61391d9
commit 084f033c87
2 changed files with 15 additions and 35 deletions

View File

@ -64,4 +64,4 @@ steps:
- git pull || true
# Push
- git push
- git push

View File

@ -1,42 +1,22 @@
# Base-Image
# -------- BUILD STAGE --------
FROM gcc:13 AS builder
FROM ubuntu:latest
WORKDIR /build
COPY deployment.c .
RUN gcc -O2 -o deployment deployment.c
# -------- RUNTIME STAGE --------
FROM debian:bookworm-slim
# Minimal installieren
RUN apt-get update && apt-get install -y \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Non-root user erstellen
RUN useradd -m appuser
# Pakete installieren
RUN apt-get update
RUN apt-get install -y build-essential gcc curl vim net-tools
# Arbeitsverzeichnis setzen
WORKDIR /app
# Binary kopieren
COPY --from=builder /build/deployment .
# alles kopieren
COPY . .
# Output-Verzeichnis
RUN mkdir /output && chown appuser:appuser /output
# Code kompilieren
RUN gcc -o deployment deployment.c
# Rechte setzen
USER appuser
# Verzeichnis für Ausgabe anlegen
RUN mkdir /output
# Volume definieren
VOLUME ["/output"]
# Healthcheck (prüft ob Datei existiert & nicht leer ist)
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s \
CMD test -s /output/output.txt || exit 1
# Start
ENTRYPOINT ["sh", "-c"]
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]
# Ausgabe wird ins Container-Dateisystem geschrieben
ENTRYPOINT ["/bin/bash", "-c"]
CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"]