diff --git a/Dockerfile b/Dockerfile index a5cdf64..a865ceb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ # Base-Image -FROM ubuntu:latest +FROM alpine3.20 AS build-env # Pakete installieren RUN apt-get update -RUN apt-get install -y build-essential gcc curl vim net-tools +RUN apt-get install --no-cache -y build-essential gcc curl vim net-tools # Arbeitsverzeichnis setzen WORKDIR /app @@ -17,6 +17,11 @@ RUN gcc -o deployment deployment.c # Verzeichnis für Ausgabe anlegen RUN mkdir /output +USER appuser + +HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ + CMD curl -f http://localhost:8080/health || exit 1 + # Ausgabe wird ins Container-Dateisystem geschrieben ENTRYPOINT ["/bin/bash", "-c"] CMD ["./deployment 10 > /output/output.txt && tail -f /output/output.txt"] \ No newline at end of file