summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorTimothy Crosley <timothy.crosley@gmail.com>2020-09-03 01:41:57 -0700
committerTimothy Crosley <timothy.crosley@gmail.com>2020-09-03 01:41:57 -0700
commita935c17e36da1facfdf2a46964be137e6ce60f5b (patch)
tree5643b7eb9aa0951b3f06a0a9b9dda079c95baa97 /Dockerfile
parent6a34b6443b1fbb31e922d413ae703859e8315850 (diff)
downloadisort-a935c17e36da1facfdf2a46964be137e6ce60f5b.tar.gz
Fix docker file, add test suite
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile21
1 files changed, 17 insertions, 4 deletions
diff --git a/Dockerfile b/Dockerfile
index ab01b320..9c2d8ac6 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,13 +1,26 @@
ARG VERSION=3
FROM python:$VERSION
-RUN mkdir /isort
-WORKDIR /isort
+# Install pip and poetry
+RUN python -m pip install --upgrade pip && python -m pip install poetry
+# Setup as minimal a stub project as posible, simply to allow caching base dependencies
+# between builds.
+#
+# If error is encountered in these steps, can safely be removed locally.
+RUN mkdir -p /isort/isort
+RUN mkdir -p /isort/tests
+RUN touch /isort/isort/__init__.py
+RUN touch /isort/tests/__init__.py
+RUN touch /isort/README.md
+WORKDIR /isort
COPY pyproject.toml poetry.lock /isort/
-RUN python -m pip install --upgrade pip && python -m pip install poetry && poetry install
+RUN poetry install
-COPY . /isort/
+# Install latest code for actual project
+RUN rm -rf /isort
+COPY . /isort
RUN poetry install
+# Run full test suite
CMD /isort/scripts/test.sh