MilesCranmer commited on
Commit
177ae5a
1 Parent(s): 2b187fd

Minimize requirements

Browse files
Files changed (2) hide show
  1. Dockerfile +7 -32
  2. gui/requirements.txt +0 -2
Dockerfile CHANGED
@@ -12,47 +12,22 @@ FROM python:${PYVERSION}-${BASE_IMAGE}
12
  COPY --from=jl /usr/local/julia /usr/local/julia
13
  ENV PATH="/usr/local/julia/bin:${PATH}"
14
 
15
- # Install dependencies for GUI:
16
- RUN apt-get update && \
17
- apt-get install -y --no-install-recommends \
18
- build-essential \
19
- git \
20
- libgl1-mesa-glx \
21
- libglib2.0-0 \
22
- libpython3-dev \
23
- libfreetype6-dev \
24
- pkg-config \
25
- libfontconfig1 \
26
- fontconfig \
27
- curl \
28
- unzip \
29
- && \
30
- apt-get clean && \
31
- rm -rf /var/lib/apt/lists/*
32
-
33
- # Install IPython and other useful libraries:
34
- RUN pip install --no-cache-dir ipython matplotlib
35
 
36
  WORKDIR /pysr
37
 
38
- # Caches install (https://stackoverflow.com/questions/25305788/how-to-avoid-reinstalling-packages-when-building-docker-image-for-python-project)
39
  ADD ./requirements.txt /pysr/requirements.txt
40
  RUN pip3 install --no-cache-dir -r /pysr/requirements.txt
41
 
42
- ################################################################################
43
- ## GUI setup
44
- # Install IBM Plex Mono font (so our plots look Gradio-style)
45
- RUN mkdir -p /usr/local/share/fonts/IBM_Plex_Mono && \
46
- curl -L https://github.com/IBM/plex/releases/download/v6.4.0/IBM-Plex-Mono.zip -o /tmp/IBM_Plex_Mono.zip && \
47
- unzip /tmp/IBM_Plex_Mono.zip -d /usr/local/share/fonts/IBM_Plex_Mono && \
48
- rm /tmp/IBM_Plex_Mono.zip
49
- RUN fc-cache -f -v
50
  ADD ./gui/requirements.txt /pysr/gui/requirements.txt
51
  RUN pip3 install --no-cache-dir -r /pysr/gui/requirements.txt
52
- ################################################################################
53
 
54
- # Install PySR:
55
- # We do a minimal copy so it doesn't need to rerun at every file change:
56
  ADD ./pyproject.toml /pysr/pyproject.toml
57
  ADD ./setup.py /pysr/setup.py
58
  ADD ./pysr /pysr/pysr
 
12
  COPY --from=jl /usr/local/julia /usr/local/julia
13
  ENV PATH="/usr/local/julia/bin:${PATH}"
14
 
15
+ # Install font used for GUI
16
+ RUN mkdir -p /usr/local/share/fonts/IBM_Plex_Mono && \
17
+ curl -L https://github.com/IBM/plex/releases/download/v6.4.0/IBM-Plex-Mono.zip -o /tmp/IBM_Plex_Mono.zip && \
18
+ unzip /tmp/IBM_Plex_Mono.zip -d /usr/local/share/fonts/IBM_Plex_Mono && \
19
+ rm /tmp/IBM_Plex_Mono.zip
20
+ RUN fc-cache -f -v
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
  WORKDIR /pysr
23
 
24
+ # Install all requirements, and then PySR itself
25
  ADD ./requirements.txt /pysr/requirements.txt
26
  RUN pip3 install --no-cache-dir -r /pysr/requirements.txt
27
 
 
 
 
 
 
 
 
 
28
  ADD ./gui/requirements.txt /pysr/gui/requirements.txt
29
  RUN pip3 install --no-cache-dir -r /pysr/gui/requirements.txt
 
30
 
 
 
31
  ADD ./pyproject.toml /pysr/pyproject.toml
32
  ADD ./setup.py /pysr/setup.py
33
  ADD ./pysr /pysr/pysr
gui/requirements.txt CHANGED
@@ -1,4 +1,2 @@
1
- numpy
2
- pandas
3
  matplotlib
4
  gradio
 
 
 
1
  matplotlib
2
  gradio