From c65f7dce14b6e6110db17147cd3f31e98705fdfe Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 2 Apr 2024 12:14:04 +1100 Subject: [PATCH] Dockerfile fixes (#6905) - Change "as" to "AS" --- Dockerfile | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index bb3f3134e3..690d3c0907 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ # - Monitors source files for any changes, and live-reloads server ARG base_image=python:3.11-alpine3.18 -FROM ${base_image} as inventree_base +FROM ${base_image} AS inventree_base # Build arguments for this image ARG commit_tag="" @@ -92,7 +92,7 @@ RUN chmod +x init.sh ENTRYPOINT ["/bin/ash", "./init.sh"] -FROM inventree_base as prebuild +FROM inventree_base AS prebuild ENV PATH=/root/.local/bin:$PATH RUN ./install_build_packages.sh --no-cache --virtual .build-deps && \ @@ -100,7 +100,7 @@ RUN ./install_build_packages.sh --no-cache --virtual .build-deps && \ apk --purge del .build-deps # Frontend builder image: -FROM prebuild as frontend +FROM prebuild AS frontend RUN apk add --no-cache --update nodejs npm && npm install -g yarn RUN yarn config set network-timeout 600000 -g @@ -112,7 +112,7 @@ RUN cd ${INVENTREE_HOME}/InvenTree && inv frontend-compile # InvenTree production image: # - Copies required files from local directory # - Starts a gunicorn webserver -FROM inventree_base as production +FROM inventree_base AS production ENV INVENTREE_DEBUG=False @@ -129,11 +129,9 @@ COPY InvenTree ./InvenTree COPY --from=frontend ${INVENTREE_HOME}/InvenTree/web/static/web ./InvenTree/web/static/web # Launch the production server -# TODO: Work out why environment variables cannot be interpolated in this command -# TODO: e.g. -b ${INVENTREE_WEB_ADDR}:${INVENTREE_WEB_PORT} fails here CMD gunicorn -c ./gunicorn.conf.py InvenTree.wsgi -b 0.0.0.0:8000 --chdir ./InvenTree -FROM inventree_base as dev +FROM inventree_base AS dev # Vite server (for local frontend development) EXPOSE 5173