Tanja Kuerzdoerfer 4a1925cedd
Some checks failed
continuous-integration/drone/push Build is failing
Dockerfile aktualisiert
2026-04-18 09:28:29 +00:00

30 lines
717 B
Docker

FROM alpine:latest
RUN apk add --no-cache \
build-base \ # entspricht build-essential + gcc + make etc.
&& rm -rf /var/cache/apk/*
RUN addgroup -S -g 10001 appgroup && \
adduser -S -u 10001 -G appgroup -h /app -s /bin/sh appuser
WORKDIR /app
COPY --chown=appuser:appgroup . .
USER appuser
RUN gcc -o deployment deployment.c -O2 # -O2 für etwas bessere Performance
RUN mkdir -p /output && \
chown appuser:appgroup /output
USER root
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
CMD pgrep deployment || exit 1
VOLUME ["/output"]
USER appuser
ENTRYPOINT ["/bin/sh", "-c"]
CMD ["./deployment 10 > /output/output.txt 2>&1 && tail -f /output/output.txt"]