File size: 778 Bytes
8a92aa5
e3ba8c9
d84f331
e3ba8c9
 
d84f331
15c28c7
8a92aa5
15c28c7
 
8a92aa5
15c28c7
 
d84f331
e3ba8c9
d84f331
15c28c7
d84f331
 
15c28c7
 
 
 
 
 
 
 
d84f331
e3ba8c9
d84f331
 
15c28c7
8a92aa5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Use the official Python 3.12 Alpine image as the base
FROM python:3.12-alpine

# Set the working directory
WORKDIR /app

# Install required system packages
RUN apk add --no-cache ffmpeg

# Create a non-root user
RUN adduser -D -u 1000 appuser

# Copy requirements and install Python packages
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the application files
COPY . .

# Set permissions for all files and directories
RUN find /app -type f -exec chmod 644 {} \; && \
    find /app -type d -exec chmod 755 {} \; && \
    chmod 644 www.youtube.com_cookies.txt && \
    chown -R appuser:appuser /app

# Switch to non-root user
USER appuser

# Expose the application port
EXPOSE 7860

# Command to run the application
CMD ["python", "srv.py"]