Run Docker container as unprivileged user

This commit is contained in:
Michał Ciania 2021-09-16 09:54:15 +02:00
parent 4f4fe39c9b
commit b558d96ed5
2 changed files with 3 additions and 1 deletions

View file

@ -28,6 +28,7 @@ RUN apt update && \
# Copy app files from build layer
COPY --from=build /app /app
USER node
EXPOSE 3001
VOLUME ["/app/data"]
HEALTHCHECK --interval=60s --timeout=30s --start-period=180s --retries=5 CMD node extra/healthcheck.js

View file

@ -17,13 +17,14 @@ FROM node:14-alpine3.12 AS release
WORKDIR /app
# Install apprise
RUN apk add --no-cache python3 py3-cryptography py3-pip py3-six py3-yaml py3-click py3-markdown py3-requests py3-requests-oauthlib && \
RUN apk add --no-cache iputils python3 py3-cryptography py3-pip py3-six py3-yaml py3-click py3-markdown py3-requests py3-requests-oauthlib && \
pip3 --no-cache-dir install apprise && \
rm -rf /root/.cache
# Copy app files from build layer
COPY --from=build /app /app
USER node
EXPOSE 3001
VOLUME ["/app/data"]
HEALTHCHECK --interval=60s --timeout=30s --start-period=180s --retries=5 CMD node extra/healthcheck.js