mirror of
https://gitea.publichub.eu/oscar.krause/fastapi-dls.git
synced 2025-11-02 09:46:04 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user