File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -23,8 +23,9 @@ FROM python:3.8.7-alpine3.12
2323# Build-time flags
2424ARG WITH_PLUGINS=true
2525
26- # Packages directory
26+ # Environment variables
2727ENV PACKAGES=/usr/local/lib/python3.8/site-packages
28+ ENV PYTHONDONTWRITEBYTECODE=1
2829
2930# Set build directory
3031WORKDIR /tmp
@@ -37,7 +38,7 @@ COPY README.md README.md
3738COPY requirements.txt requirements.txt
3839COPY setup.py setup.py
3940
40- # Perform build and cleanup artifacts
41+ # Perform build and cleanup artifacts and caches
4142RUN \
4243 apk add --no-cache \
4344 git \
4849 && \
4950 if [ "${WITH_PLUGINS}" = "true" ]; then \
5051 pip install --no-cache-dir \
51- ' mkdocs-minify-plugin>=0.3' \
52- ' mkdocs-redirects>=1.0' ; \
52+ " mkdocs-minify-plugin>=0.3" \
53+ " mkdocs-redirects>=1.0" ; \
5354 fi \
5455 && apk del .build gcc musl-dev \
5556 && \
5960 ${PACKAGES}/material \
6061 ${PACKAGES}/mkdocs/themes/$theme; \
6162 done \
62- && rm -rf /tmp/*
63+ && rm -rf /tmp/* /root/.cache \
64+ && \
65+ find ${PACKAGES} \
66+ -type f \
67+ -path "*/__pycache__/*" \
68+ -exec rm -f {} \;
6369
6470# Set working directory
6571WORKDIR /docs
You can’t perform that action at this time.
0 commit comments