ssiisnsksksnsjsksk commited on
Commit
d84f331
·
verified ·
1 Parent(s): d59e5b4

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -0
Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim
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
+ # Set permissions for all files and directories
19
+ RUN find /app -type f -exec chmod 644 {} \; && \
20
+ find /app -type d -exec chmod 755 {} \; && \
21
+ chmod 644 www.youtube.com_cookies.txt && \
22
+ chown -R appuser:appuser /app
23
+
24
+ # Switch to non-root user
25
+ USER appuser
26
+
27
+ EXPOSE 7860
28
+
29
+ CMD ["python", "srv.py"]