Spaces:
Runtime error
Runtime error
谦言
commited on
Commit
·
7218539
1
Parent(s):
d22446e
add dockerfile
Browse files- Dockerfile +28 -0
Dockerfile
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM registry.us-west-1.aliyuncs.com/modelscope-repo/modelscope:ubuntu22.04-cuda11.8.0-py310-torch2.1.0-tf2.14.0-1.10.0
|
| 2 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 3 |
+
RUN apt-get update && \
|
| 4 |
+
apt-get upgrade -y && \
|
| 5 |
+
apt-get install -y --no-install-recommends
|
| 6 |
+
|
| 7 |
+
RUN useradd -m -u 1000 user
|
| 8 |
+
USER user
|
| 9 |
+
ENV HOME=/home/user \
|
| 10 |
+
PATH=/home/user/.local/bin:${PATH}
|
| 11 |
+
WORKDIR ${HOME}/app
|
| 12 |
+
|
| 13 |
+
COPY --chown=1000 ./requirements.txt /tmp/requirements.txt
|
| 14 |
+
RUN pip install -r /tmp/requirements.txt
|
| 15 |
+
RUN pip install https://modelscope-agent.oss-cn-hangzhou.aliyuncs.com/releases/v0.2.4/modelscope_agent-0.2.4rc2-py3-none-any.whl
|
| 16 |
+
|
| 17 |
+
COPY --chown=1000 . ${HOME}/app
|
| 18 |
+
RUN chown -R user:users /mnt/workspace/
|
| 19 |
+
|
| 20 |
+
ENV MODELSCOPE_CACHE=${HOME}/cache \
|
| 21 |
+
PYTHONPATH=${HOME}/app \
|
| 22 |
+
PYTHONUNBUFFERED=1 \
|
| 23 |
+
GRADIO_ALLOW_FLAGGING=never \
|
| 24 |
+
GRADIO_NUM_PORTS=1 \
|
| 25 |
+
GRADIO_SERVER_NAME=0.0.0.0 \
|
| 26 |
+
GRADIO_THEME=huggingface \
|
| 27 |
+
SYSTEM=spaces
|
| 28 |
+
CMD ["python", "app.py"]
|