vbvbot9117 commited on
Commit
f6066f5
·
verified ·
1 Parent(s): b302985

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -0
Dockerfile CHANGED
@@ -2,13 +2,30 @@ FROM python:3.9-slim
2
 
3
  WORKDIR /app
4
 
 
5
  RUN apt-get update && apt-get install -y ffmpeg
6
 
 
 
 
 
7
  COPY requirements.txt .
8
  RUN pip install -r requirements.txt
9
 
 
10
  COPY . .
11
 
 
 
 
 
 
 
 
 
 
 
 
12
  EXPOSE 7860
13
 
14
  CMD ["python", "srv.py"]
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install required system packages
6
  RUN apt-get update && apt-get install -y ffmpeg
7
 
8
+ # Create a non-root user
9
+ RUN useradd -m -u 1000 appuser
10
+
11
+ # Copy requirements and install Python packages
12
  COPY requirements.txt .
13
  RUN pip install -r requirements.txt
14
 
15
+ # Copy the application files
16
  COPY . .
17
 
18
+ # Create cookies file and set permissions
19
+ RUN touch www.youtube.com_cookies.txt && \
20
+ chown appuser:appuser www.youtube.com_cookies.txt && \
21
+ chmod 644 www.youtube.com_cookies.txt
22
+
23
+ # Set permissions for the app directory
24
+ RUN chown -R appuser:appuser /app
25
+
26
+ # Switch to non-root user
27
+ USER appuser
28
+
29
  EXPOSE 7860
30
 
31
  CMD ["python", "srv.py"]