diff options
author | Benjamin Bach <benjamin@overtag.dk> | 2022-08-24 17:49:29 +0300 |
---|---|---|
committer | Benjamin Bach <benjamin@overtag.dk> | 2022-08-24 17:49:29 +0300 |
commit | ba059c7970ad71fe5bcbf1e358b74b52474b29e0 (patch) | |
tree | 1b5b88b87dec927c4ab360e53d2fbed206cc41dd /Dockerfile | |
parent | 4393bd2039e1b9444e2e68a00b24775f0dfc89c8 (diff) |
Wrapping up the Docker work, using docker cp again in order to copy assets out of containers
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 19 |
1 files changed, 12 insertions, 7 deletions
@@ -8,23 +8,25 @@ RUN apk add npm make py3-pip py3-wheel # Add an extra verification that we have the right node # because the above caused issues -RUN python3 --version RUN node -v && node -v | grep -q v14 &&\ python3 --version && python3 --version | grep -q "3.10" RUN pip install pip --upgrade RUN mkdir -p /project/src/ &&\ - mkdir -p /project/docs/ &&\ + mkdir -p /project/docs/build/ &&\ mkdir -p /project-minimal-copy/sphinx_rtd_theme &&\ touch /project-minimal-copy/sphinx_rtd_theme/__init__.py +# This is the main working directory where node_modules +# gets built. During runtime, it's mixed with directories +# from an external environment through a bind mount WORKDIR /project +# Copy files necessary to run "npm install" and save +# installed packages in the docker image (makes the runtime +# so much faster) COPY package.json /project/ - -# COPY package-lock.json /project/ - COPY bin/preinstall.js /project/bin/preinstall.js RUN cd /project @@ -37,16 +39,19 @@ RUN npm install --package-lock-only &&\ # This is strictly speaking not necessary, just makes # running the container faster... -# Install dependencies, then uninstall project itsel +# Install dependencies, then uninstall project itself COPY setup.py README.rst /project-minimal-copy/ RUN cd /project-minimal-copy &&\ pip install ".[dev]" &&\ /usr/bin/yes | pip uninstall sphinx_rtd_theme -# Copy in stuff we need to run the project +# Copy in files that we need to run the project. These files +# will not be mounted into the runtime from external environment +# so we copy them during build. COPY webpack.common.js webpack.dev.js webpack.prod.js /project/ +# Copy in the entrypoint and we're done COPY docker-entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh |