improved docker build with "ARG" instead of using "version.env" which is not present on local builds (because it's created by ci-pipeline)

This commit is contained in:
Oscar Krause
2023-05-09 06:57:03 +02:00
parent d1a77df0e1
commit 774a1c21a1
2 changed files with 17 additions and 14 deletions

View File

@@ -1,5 +1,9 @@
FROM python:3.11-alpine
ARG VERSION
ARG COMMIT=""
RUN echo -e "VERSION=$VERSION\nCOMMIT=$COMMIT" > /version.env
COPY requirements.txt /tmp/requirements.txt
RUN apk update \
@@ -11,7 +15,6 @@ RUN apk update \
&& apk del build-deps
COPY app /app
COPY version.env /version.env
COPY README.md /README.md
HEALTHCHECK --start-period=30s --interval=10s --timeout=5s --retries=3 CMD curl --insecure --fail https://localhost/-/health || exit 1