kingtest commited on
Commit
6262276
1 Parent(s): 28abf3d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -2
Dockerfile CHANGED
@@ -9,10 +9,22 @@ WORKDIR /app
9
  # Install git
10
  RUN apt-get update && apt-get install -y git
11
 
12
- # 安装git,克隆仓库,然后移除git以减小镜像体积
13
- RUN git clone https://github.com/Chenyme/oaifree-tools.git /app
 
 
 
 
 
 
14
 
15
  # Install dependencies
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
 
 
 
 
 
 
18
  CMD ["streamlit", "run", "/app/home.py"]
 
9
  # Install git
10
  RUN apt-get update && apt-get install -y git
11
 
12
+ # Clone the repository
13
+ RUN git clone https://github.com/Chenyme/oaifree-tools.git .
14
+
15
+ # Create a non-root user
16
+ RUN useradd -m myuser
17
+
18
+ # Create log directory and set ownership
19
+ RUN mkdir -p /app/config && chown -R myuser:myuser /app
20
 
21
  # Install dependencies
22
  RUN pip install --no-cache-dir -r requirements.txt
23
 
24
+ # 暴露容器端口
25
+ EXPOSE 8501
26
+
27
+ # Switch to non-root user
28
+ USER myuser
29
+
30
  CMD ["streamlit", "run", "/app/home.py"]