Dockerfile aktualisiert
This commit is contained in:
parent
2cba107371
commit
e3cf61fe0f
25
Dockerfile
25
Dockerfile
@ -1,26 +1,27 @@
|
|||||||
FROM alpine:latest
|
|
||||||
|
FROM alpine:latest AS builder
|
||||||
|
|
||||||
RUN apk add --no-cache build-base
|
RUN apk add --no-cache build-base
|
||||||
|
|
||||||
|
WORKDIR /build
|
||||||
|
COPY deployment.c .
|
||||||
|
|
||||||
|
|
||||||
|
RUN gcc -static -o deployment deployment.c
|
||||||
|
|
||||||
|
FROM alpine:latest
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN adduser -D appuser && mkdir /output && chown appuser:appuser /app /output
|
COPY --from=builder /build/deployment .
|
||||||
|
|
||||||
|
|
||||||
COPY . .
|
|
||||||
RUN chown appuser:appuser deployment.c
|
|
||||||
|
|
||||||
|
RUN adduser -D appuser && \
|
||||||
|
mkdir /output && \
|
||||||
|
chown -R appuser:appuser /app /output
|
||||||
|
|
||||||
USER appuser
|
USER appuser
|
||||||
|
|
||||||
|
|
||||||
RUN gcc -o deployment deployment.c
|
|
||||||
|
|
||||||
|
|
||||||
VOLUME /output
|
VOLUME /output
|
||||||
|
|
||||||
|
|
||||||
HEALTHCHECK --interval=30s --timeout=5s CMD test -f /output/output.txt || exit 1
|
HEALTHCHECK --interval=30s --timeout=5s CMD test -f /output/output.txt || exit 1
|
||||||
|
|
||||||
|
|
||||||
CMD ["sh", "-c", "./deployment 10 > /output/output.txt && tail -f /output/output.txt"]
|
CMD ["sh", "-c", "./deployment 10 > /output/output.txt && tail -f /output/output.txt"]
|
||||||
Loading…
x
Reference in New Issue
Block a user