|
| 1 | +# python:3-alpine contains node 18 so has to go first |
| 2 | +# in order to get overwritten |
| 3 | +FROM python:3-alpine |
| 4 | +FROM node:14-alpine |
| 5 | + |
| 6 | +# Do not use --update since that will also fetch the |
| 7 | +# latest node-current package |
| 8 | +# 'make' is needed for building documentation |
| 9 | +RUN apk add npm make py3-pip py3-wheel |
| 10 | + |
| 11 | +# Add an extra verification that we have the right node |
| 12 | +# because the above caused issues |
| 13 | +RUN node -v && node -v | grep -q v14 |
| 14 | + |
| 15 | +RUN pip install pip --upgrade |
| 16 | + |
| 17 | +RUN mkdir -p /project/src/ &&\ |
| 18 | + mkdir -p /project/docs/ &&\ |
| 19 | + mkdir -p /project-static-copy |
| 20 | + |
| 21 | +WORKDIR /project |
| 22 | + |
| 23 | +COPY package.json /project/ |
| 24 | + |
| 25 | +# COPY package-lock.json /project/ |
| 26 | + |
| 27 | +COPY bin/preinstall.js /project/bin/preinstall.js |
| 28 | + |
| 29 | +RUN cd /project |
| 30 | + |
| 31 | +# It matters that the node environment is installed into the same |
| 32 | +# folder, i.e. /project where we will run the environment from |
| 33 | +RUN npm install --package-lock-only &&\ |
| 34 | + npm audit fix &&\ |
| 35 | + npm install |
| 36 | + |
| 37 | +# This is strictly speaking not necessary, just makes |
| 38 | +# running the container faster... |
| 39 | +# Install dependencies, then uninstall project itself |
| 40 | +COPY . /project-static-copy |
| 41 | +RUN cd /project-static-copy &&\ |
| 42 | + pip install ".[dev]" &&\ |
| 43 | + /usr/bin/yes | pip uninstall sphinx_rtd_theme |
| 44 | + |
| 45 | + |
| 46 | +# Copy in stuff we need to run the project |
| 47 | +COPY webpack.common.js webpack.dev.js webpack.prod.js /project/ |
| 48 | + |
| 49 | +COPY docker-entrypoint.sh /entrypoint.sh |
| 50 | +RUN chmod +x /entrypoint.sh |
| 51 | + |
| 52 | +ENTRYPOINT ["/entrypoint.sh"] |
0 commit comments