|
|
|
FROM python:3.9.13 |
|
|
|
|
|
ENV HOME=/home/user |
|
ENV PATH=$HOME/.local/bin:$PATH |
|
|
|
|
|
RUN useradd -m -u 1000 user |
|
RUN chown -R user:user $HOME |
|
|
|
|
|
WORKDIR $HOME/app |
|
|
|
|
|
RUN git clone https://github.com/openai/shap-e . |
|
|
|
|
|
COPY --chown=user . . |
|
|
|
|
|
RUN echo "-e ." > requirements.txt \ |
|
&& echo "flask" >> requirements.txt \ |
|
&& echo "flask_cors" >> requirements.txt \ |
|
&& echo "PyYAML" >> requirements.txt \ |
|
&& echo "ipywidgets" >> requirements.txt \ |
|
&& echo "gunicorn" >> requirements.txt |
|
|
|
|
|
RUN mkdir -p $HOME/app/shap_e_model_cache |
|
RUN chown -R user:user $HOME/app/shap_e_model_cache |
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
ENV NUMBA_CACHE_DIR=/tmp/numba_cache |
|
|
|
|
|
CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"] |
|
|