Build demo before copying python code, for better caching behavior
@@ -49,15 +49,15 @@ COPY scripts/install_requirements.sh scripts/install_requirements.sh
RUN INSTALL_TEST_REQUIREMENTS="true" ./scripts/install_requirements.sh
RUN pip install --no-cache-dir -q http://download.pytorch.org/whl/cu80/torch-0.2.0.post3-cp36-cp36m-manylinux1_x86_64.whl
-COPY allennlp/ allennlp/
+# Build demo
COPY demo/ demo/
+RUN cd demo && npm install && npm run build && cd ..
+
+COPY allennlp/ allennlp/
COPY tests/ tests/
COPY pytest.ini pytest.ini
COPY scripts/ scripts/
COPY tutorials/ tutorials/
-# Build demo
-RUN cd demo && npm install && npm run build && cd ..
-
# Run tests to verify the Docker build
RUN PYTHONDONTWRITEBYTECODE=1 pytest
