Skip to content

Commit 208c84d

Browse files
committed
Fix node.js error in docker runtime, speed up build by not copying the entire context
1 parent 83e1220 commit 208c84d

File tree

3 files changed

+382
-362
lines changed

3 files changed

+382
-362
lines changed

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ RUN pip install pip --upgrade
1616

1717
RUN mkdir -p /project/src/ &&\
1818
mkdir -p /project/docs/ &&\
19-
mkdir -p /project-static-copy
19+
mkdir -p /project-minimal-copy/sphinx_rtd_theme &&\
20+
touch /project-minimal-copy/sphinx_rtd_theme/__init__.py
2021

2122
WORKDIR /project
2223

@@ -36,9 +37,9 @@ RUN npm install --package-lock-only &&\
3637

3738
# This is strictly speaking not necessary, just makes
3839
# running the container faster...
39-
# Install dependencies, then uninstall project itself
40-
COPY . /project-static-copy
41-
RUN cd /project-static-copy &&\
40+
# Install dependencies, then uninstall project itsel
41+
COPY setup.py README.rst /project-minimal-copy/
42+
RUN cd /project-minimal-copy &&\
4243
pip install ".[dev]" &&\
4344
/usr/bin/yes | pip uninstall sphinx_rtd_theme
4445

docker-entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,11 @@ cp -r /project/node_modules /project-working-copy/
77
cd /project-working-copy
88
pip install --upgrade -e ".[dev]"
99

10+
# This helps a potential permission issue, but might be removed
11+
# pending some more investigation of docker host file system
12+
# permissions in the bind mount
13+
npm cache clean --force
14+
npm install
15+
16+
echo "Going to invoke: npm run $@"
1017
npm run $@

0 commit comments

Comments
 (0)