Skip to content

Commit

Permalink
Remove the pip cache in the docker image to reduce the size
Browse files Browse the repository at this point in the history
  • Loading branch information
mfitz committed Apr 6, 2022
1 parent 265c8e5 commit 7630421
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/__pycache__
**/.pytest_cache/
.git
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@ FROM python:3.7-slim-stretch

RUN apt-get update && \
apt-get upgrade -y && \
apt-get -y install gcc git libspatialindex-dev curl && \
apt-get -y install gcc git libspatialindex-dev curl coinor-cbc && \
rm -rf /var/lib/apt/lists/*

RUN curl -sL https://deb.nodesource.com/setup_17.x | bash -
RUN apt-get -y install nodejs && node --version && npm --version
RUN apt-get -y install nodejs && node --version && npm --version && \
rm -rf /var/lib/apt/lists/*

RUN apt-get install -y coinor-cbc
#RUN apt-get install -y coinor-cbc && \
#rm -rf /var/lib/apt/lists/*

RUN /usr/local/bin/python -m pip install --upgrade pip
RUN /usr/local/bin/python -m pip install --no-cache-dir --compile --upgrade pip

COPY ./scripts .
COPY . .

RUN pip3 install -e .
RUN pip3 install --no-cache-dir --compile -e . && pip cache purge
ENV PYTHONPATH=./scripts:${PYTHONPATH}

ENTRYPOINT ["python3"]

0 comments on commit 7630421

Please sign in to comment.