wenmeng zhou commited on
Commit
e8cfe45
β€’
1 Parent(s): 8e3b8e6

Update Dockerfile

Browse files

use user to run docker

Files changed (1) hide show
  1. Dockerfile +13 -11
Dockerfile CHANGED
@@ -1,19 +1,21 @@
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
- # RUN useradd -m -u 1000 user
7
- # USER user
8
- # ENV HOME=/home/user \
9
- # PATH=/home/user/.local/bin:${PATH}
10
- # WORKDIR ${HOME}/app
11
 
12
- COPY ./requirements.txt /tmp/requirements.txt
13
  RUN pip install -r /tmp/requirements.txt
14
 
15
- COPY . /root/app
16
- ENV PYTHONPATH=/root/app \
 
 
17
  PYTHONUNBUFFERED=1 \
18
  GRADIO_ALLOW_FLAGGING=never \
19
  GRADIO_NUM_PORTS=1 \
 
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
+ RUN useradd -m -u 1000 user
7
+ USER user
8
+ ENV HOME=/home/user \
9
+ PATH=/home/user/.local/bin:${PATH}
10
+ WORKDIR ${HOME}/app
11
 
12
+ COPY --chown=1000 ./requirements.txt /tmp/requirements.txt
13
  RUN pip install -r /tmp/requirements.txt
14
 
15
+ COPY --chown=1000 . ${HOME}/app
16
+ RUN chown -R user:users /mnt/workspace/
17
+
18
+ ENV PYTHONPATH=${HOME}/app \
19
  PYTHONUNBUFFERED=1 \
20
  GRADIO_ALLOW_FLAGGING=never \
21
  GRADIO_NUM_PORTS=1 \