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

This commit is contained in:
Tanja Kuerzdoerfer 2026-04-19 07:29:11 +00:00
parent 3855a269bf
commit 3eba9b606c

View File

@ -1,27 +1,21 @@
FROM alpine:latest FROM alpine:3.19 AS builder
RUN apk add --no-cache gcc musl-dev
WORKDIR /app
COPY deployment.c .
RUN gcc -static -O2 -s -o deployment deployment.c && strip deployment
RUN apk add --no-cache build-base && \ FROM alpine:3.19
rm -rf /var/cache/apk/* RUN apk add --no-cache bash coreutils && rm -rf /var/cache/apk/*
RUN addgroup -g 1000 appuser && adduser -u 1000 -G appuser -s /bin/bash -D appuser
RUN mkdir -p /app /output && chown -R appuser:appuser /app /output
RUN addgroup -S -g 10001 appgroup && \ COPY --from=builder --chown=appuser:appuser /app/deployment /app/
adduser -S -u 10001 -G appgroup -h /app -s /bin/sh appuser
WORKDIR /app WORKDIR /app
COPY --chown=appuser:appgroup . .
USER appuser
RUN gcc -o deployment deployment.c -O2 -static
USER root
RUN mkdir -p /output && \
chown -R appuser:appgroup /output && \
chmod -R 755 /output
VOLUME ["/output"] VOLUME ["/output"]
USER appuser USER appuser
ENTRYPOINT ["/bin/sh", "-c"] HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD ["./deployment 10 > /output/output.txt 2>&1 && exec tail -f /output/output.txt"] CMD test -f /output/output.txt || exit 1
CMD ["/bin/bash", "-c", "./deployment 10 > /output/output.txt && tail -f /output/output.txt"]