diff --git a/template/python3-flask/Dockerfile b/template/python3-flask/Dockerfile index e60eede..932522b 100644 --- a/template/python3-flask/Dockerfile +++ b/template/python3-flask/Dockerfile @@ -5,12 +5,15 @@ FROM --platform=${TARGETPLATFORM:-linux/amd64} python:${PYTHON_VERSION}-alpine A COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog RUN chmod +x /usr/bin/fwatchdog +ARG UPGRADE_PACKAGES=false + ARG ADDITIONAL_PACKAGE # Alternatively use ADD https:// (which will not be cached by Docker builder) -RUN apk --no-cache add openssl-dev ${ADDITIONAL_PACKAGE} +RUN if [ "${UPGRADE_PACKAGES}" = "true" ] || [ "${UPGRADE_PACKAGES}" = "1" ]; then apk --no-cache upgrade; fi && \ + apk --no-cache add openssl-dev ${ADDITIONAL_PACKAGE} -# Add non root user + # Add non root user RUN addgroup -S app && adduser app -S -G app RUN chown app /home/app diff --git a/template/python3-http/Dockerfile b/template/python3-http/Dockerfile index 605e86f..837a032 100644 --- a/template/python3-http/Dockerfile +++ b/template/python3-http/Dockerfile @@ -5,10 +5,12 @@ FROM --platform=${TARGETPLATFORM:-linux/amd64} python:${PYTHON_VERSION}-alpine A COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog RUN chmod +x /usr/bin/fwatchdog +ARG UPGRADE_PACKAGES ARG ADDITIONAL_PACKAGE # Alternatively use ADD https:// (which will not be cached by Docker builder) -RUN apk --no-cache add ${ADDITIONAL_PACKAGE} +RUN if [ "${UPGRADE_PACKAGES}" = "true" ] || [ "${UPGRADE_PACKAGES}" = "1" ]; then apk --no-cache upgrade; fi && \ + apk --no-cache add ${ADDITIONAL_PACKAGE} # Add non root user RUN addgroup -S app && adduser app -S -G app