mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 19:46:46 +00:00
parent
cfff6ad93e
commit
c65f7dce14
12
Dockerfile
12
Dockerfile
@ -10,7 +10,7 @@
|
|||||||
# - Monitors source files for any changes, and live-reloads server
|
# - Monitors source files for any changes, and live-reloads server
|
||||||
|
|
||||||
ARG base_image=python:3.11-alpine3.18
|
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
|
# Build arguments for this image
|
||||||
ARG commit_tag=""
|
ARG commit_tag=""
|
||||||
@ -92,7 +92,7 @@ RUN chmod +x init.sh
|
|||||||
|
|
||||||
ENTRYPOINT ["/bin/ash", "./init.sh"]
|
ENTRYPOINT ["/bin/ash", "./init.sh"]
|
||||||
|
|
||||||
FROM inventree_base as prebuild
|
FROM inventree_base AS prebuild
|
||||||
|
|
||||||
ENV PATH=/root/.local/bin:$PATH
|
ENV PATH=/root/.local/bin:$PATH
|
||||||
RUN ./install_build_packages.sh --no-cache --virtual .build-deps && \
|
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
|
apk --purge del .build-deps
|
||||||
|
|
||||||
# Frontend builder image:
|
# Frontend builder image:
|
||||||
FROM prebuild as frontend
|
FROM prebuild AS frontend
|
||||||
|
|
||||||
RUN apk add --no-cache --update nodejs npm && npm install -g yarn
|
RUN apk add --no-cache --update nodejs npm && npm install -g yarn
|
||||||
RUN yarn config set network-timeout 600000 -g
|
RUN yarn config set network-timeout 600000 -g
|
||||||
@ -112,7 +112,7 @@ RUN cd ${INVENTREE_HOME}/InvenTree && inv frontend-compile
|
|||||||
# InvenTree production image:
|
# InvenTree production image:
|
||||||
# - Copies required files from local directory
|
# - Copies required files from local directory
|
||||||
# - Starts a gunicorn webserver
|
# - Starts a gunicorn webserver
|
||||||
FROM inventree_base as production
|
FROM inventree_base AS production
|
||||||
|
|
||||||
ENV INVENTREE_DEBUG=False
|
ENV INVENTREE_DEBUG=False
|
||||||
|
|
||||||
@ -129,11 +129,9 @@ COPY InvenTree ./InvenTree
|
|||||||
COPY --from=frontend ${INVENTREE_HOME}/InvenTree/web/static/web ./InvenTree/web/static/web
|
COPY --from=frontend ${INVENTREE_HOME}/InvenTree/web/static/web ./InvenTree/web/static/web
|
||||||
|
|
||||||
# Launch the production server
|
# 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
|
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)
|
# Vite server (for local frontend development)
|
||||||
EXPOSE 5173
|
EXPOSE 5173
|
||||||
|
Loading…
x
Reference in New Issue
Block a user