diff --git a/Dockerfile b/Dockerfile index ba81f97a6a..9ab4b9e3df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -94,8 +94,9 @@ ENTRYPOINT ["/bin/sh", "./init.sh"] FROM inventree_base as prebuild +ENV PATH=/root/.local/bin:$PATH RUN ./install_build_packages.sh --no-cache --virtual .build-deps && \ - pip install -r base_requirements.txt -r requirements.txt --no-cache-dir && \ + pip install --user -r base_requirements.txt -r requirements.txt --no-cache-dir && \ apk --purge del .build-deps # Frontend builder image: @@ -111,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 prebuild as production +FROM inventree_base as production ENV INVENTREE_DEBUG=False @@ -119,6 +120,10 @@ ENV INVENTREE_DEBUG=False ENV INVENTREE_COMMIT_HASH="${commit_hash}" ENV INVENTREE_COMMIT_DATE="${commit_date}" +# use dependencies and compiled wheels from the prebuild image +ENV PATH=/root/.local/bin:$PATH +COPY --from=prebuild /root/.local /root/.local + # Copy source code COPY InvenTree ./InvenTree COPY --from=frontend ${INVENTREE_HOME}/InvenTree/web/static/web ./InvenTree/web/static/web