2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-12 01:55:39 +00:00

Development docker image

- Uses multistage build
- Adds a docker compose file for dev
This commit is contained in:
Oliver Walters
2021-05-10 14:23:17 +10:00
parent d301794516
commit 914db9e913
4 changed files with 80 additions and 1 deletions

View File

@ -1,4 +1,4 @@
FROM python:alpine as production
FROM python:alpine as base
# GitHub source
ARG repository="https://github.com/inventree/InvenTree.git"
@ -73,6 +73,7 @@ RUN pip install --no-cache-dir -U invoke
RUN pip install --no-cache-dir -U psycopg2 mysqlclient pgcli mariadb
RUN pip install --no-cache-dir -U gunicorn
FROM base as production
# Clone source code
RUN echo "Downloading InvenTree from ${INVENTREE_REPO}"
RUN git clone --branch ${INVENTREE_BRANCH} --depth 1 ${INVENTREE_REPO} ${INVENTREE_SRC_DIR}
@ -97,3 +98,9 @@ WORKDIR ${INVENTREE_SRC_DIR}
# Let us begin
CMD ["bash", "./start_prod_server.sh"]
FROM base as dev
# The development image requires the source code to be mounted to /home/inventree/src/
# So from here, we don't actually "do" anything
WORKDIR ${INVENTREE_SRC_DIR}