Spaces:
Sleeping
Sleeping
File size: 1,580 Bytes
3fab691 b07cceb 16a1040 3fab691 01af194 3b043d9 01af194 3b043d9 16a1040 562ae7b e893f23 562ae7b de7035d 19a57f0 562ae7b 60bdb91 16a1040 25e01ad e893f23 25e01ad 16a1040 e893f23 562ae7b 16a1040 01af194 9a8886b 01af194 60bdb91 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
FROM julia:1.10.0 AS jl
FROM python:3.12
COPY --from=jl /usr/local/julia /usr/local/julia
ENV PATH="/usr/local/julia/bin:${PATH}"
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
git \
libgl1-mesa-glx \
libglib2.0-0 \
libpython3-dev \
libfreetype6-dev \
pkg-config \
libfontconfig1 \
fontconfig \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY fonts/*.ttf /usr/local/share/fonts/
RUN fc-cache -f -v
WORKDIR /code
COPY ./requirements.txt /code/requirements.txt
# Set up a new user named "user" with user ID 1000
RUN useradd -m -u 1000 user
# Switch to the "user" user
USER user
WORKDIR /home/user/
# Set home to the user's home directory
ENV HOME=/home/user
ENV PATH=/home/user/.local/bin:$PATH
RUN python -m venv /home/user/.venv
# Install Python dependencies in a virtual environment
RUN /home/user/.venv/bin/python -m pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Install and pre-compile Julia dependencies,
# including the Bumper extension
RUN /home/user/.venv/bin/python -c "import pysr"
RUN /home/user/.venv/bin/python -c "import pysr; pysr.PySRRegressor(bumper=True, verbosity=0, progress=False, max_evals=1).fit([[1]], [1])"
WORKDIR /home/user/app
COPY --chown=user . $HOME/app
EXPOSE 7860
ENV GRADIO_ALLOW_FLAGGING=never \
GRADIO_NUM_PORTS=1 \
GRADIO_SERVER_NAME=0.0.0.0 \
GRADIO_THEME=huggingface \
SYSTEM=spaces
CMD ["/bin/bash", "-l", "-c", "/home/user/.venv/bin/python /home/user/app/app.py"]
|