Fix node.js error in docker runtime, speed up build by not copying the entire context

This commit is contained in:
Benjamin Bach
2022-08-23 23:29:24 +02:00
parent 83e122054c
commit 208c84d427
3 changed files with 382 additions and 362 deletions

View File

@@ -16,7 +16,8 @@ RUN pip install pip --upgrade
RUN mkdir -p /project/src/ &&\
mkdir -p /project/docs/ &&\
mkdir -p /project-static-copy
mkdir -p /project-minimal-copy/sphinx_rtd_theme &&\
touch /project-minimal-copy/sphinx_rtd_theme/__init__.py
WORKDIR /project
@@ -36,9 +37,9 @@ RUN npm install --package-lock-only &&\
# This is strictly speaking not necessary, just makes
# running the container faster...
# Install dependencies, then uninstall project itself
COPY . /project-static-copy
RUN cd /project-static-copy &&\
# Install dependencies, then uninstall project itsel
COPY setup.py README.rst /project-minimal-copy/
RUN cd /project-minimal-copy &&\
pip install ".[dev]" &&\
/usr/bin/yes | pip uninstall sphinx_rtd_theme

View File

@@ -7,4 +7,11 @@ cp -r /project/node_modules /project-working-copy/
cd /project-working-copy
pip install --upgrade -e ".[dev]"
# This helps a potential permission issue, but might be removed
# pending some more investigation of docker host file system
# permissions in the bind mount
npm cache clean --force
npm install
echo "Going to invoke: npm run $@"
npm run $@

728
package-lock.json generated

File diff suppressed because it is too large Load Diff