Spaces:
Running
Running
MilesCranmer
commited on
Commit
•
bccdea1
1
Parent(s):
6cb0a58
Fix permissions issue in docker GUI
Browse files- Dockerfile +25 -13
Dockerfile
CHANGED
@@ -19,22 +19,36 @@ RUN mkdir -p /usr/local/share/fonts/IBM_Plex_Mono && \
|
|
19 |
rm /tmp/IBM_Plex_Mono.zip
|
20 |
RUN fc-cache -f -v
|
21 |
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
# Install all requirements, and then PySR itself
|
25 |
-
|
26 |
-
RUN
|
27 |
|
28 |
-
|
29 |
-
RUN
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
RUN
|
35 |
|
36 |
# Install Julia pre-requisites:
|
37 |
-
RUN
|
|
|
|
|
38 |
|
39 |
EXPOSE 7860
|
40 |
ENV GRADIO_ALLOW_FLAGGING=never \
|
@@ -43,11 +57,9 @@ ENV GRADIO_ALLOW_FLAGGING=never \
|
|
43 |
GRADIO_THEME=huggingface \
|
44 |
SYSTEM=spaces
|
45 |
|
46 |
-
ADD ./gui/app.py /pysr/gui/app.py
|
47 |
-
|
48 |
# metainformation
|
49 |
LABEL org.opencontainers.image.authors = "Miles Cranmer"
|
50 |
LABEL org.opencontainers.image.source = "https://github.com/MilesCranmer/PySR"
|
51 |
LABEL org.opencontainers.image.licenses = "Apache License 2.0"
|
52 |
|
53 |
-
CMD ["
|
|
|
19 |
rm /tmp/IBM_Plex_Mono.zip
|
20 |
RUN fc-cache -f -v
|
21 |
|
22 |
+
# Set up a new user named "user" with user ID 1000
|
23 |
+
RUN useradd -m -u 1000 user
|
24 |
+
USER user
|
25 |
+
WORKDIR /home/user/
|
26 |
+
ENV HOME=/home/user
|
27 |
+
ENV PATH=/home/user/.local/bin:$PATH
|
28 |
+
|
29 |
+
RUN python -m venv $HOME/.venv
|
30 |
+
|
31 |
+
ENV PYTHON="${HOME}/.venv/bin/python"
|
32 |
+
ENV PIP="${PYTHON} -m pip"
|
33 |
+
|
34 |
+
WORKDIR $HOME/pysr
|
35 |
|
36 |
# Install all requirements, and then PySR itself
|
37 |
+
COPY --chown=user ./requirements.txt $HOME/pysr/requirements.txt
|
38 |
+
RUN $PIP install --no-cache-dir -r $HOME/pysr/requirements.txt
|
39 |
|
40 |
+
COPY --chown=user ./gui/requirements.txt $HOME/pysr/gui/requirements.txt
|
41 |
+
RUN $PIP install --no-cache-dir -r $HOME/pysr/gui/requirements.txt
|
42 |
|
43 |
+
COPY --chown=user ./pyproject.toml $HOME/pysr/pyproject.toml
|
44 |
+
COPY --chown=user ./setup.py $HOME/pysr/setup.py
|
45 |
+
COPY --chown=user ./pysr $HOME/pysr/pysr
|
46 |
+
RUN $PIP install --no-cache-dir .
|
47 |
|
48 |
# Install Julia pre-requisites:
|
49 |
+
RUN $PYTHON -c 'import pysr'
|
50 |
+
|
51 |
+
COPY --chown=user ./gui/app.py $HOME/pysr/gui/app.py
|
52 |
|
53 |
EXPOSE 7860
|
54 |
ENV GRADIO_ALLOW_FLAGGING=never \
|
|
|
57 |
GRADIO_THEME=huggingface \
|
58 |
SYSTEM=spaces
|
59 |
|
|
|
|
|
60 |
# metainformation
|
61 |
LABEL org.opencontainers.image.authors = "Miles Cranmer"
|
62 |
LABEL org.opencontainers.image.source = "https://github.com/MilesCranmer/PySR"
|
63 |
LABEL org.opencontainers.image.licenses = "Apache License 2.0"
|
64 |
|
65 |
+
CMD ["/home/user/.venv/bin/python", "/home/user/pysr/gui/app.py"]
|