File size: 830 Bytes
e7542dc
 
bf4a976
e7542dc
 
bf4a976
 
 
e7542dc
 
 
 
 
bf4a976
 
adc6b45
bf4a976
e7542dc
bf4a976
e7542dc
 
 
 
 
 
 
 
bf4a976
e7542dc
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
# Use the official telegram-bot-api image as the base (built on Alpine Linux)
FROM aiogram/telegram-bot-api:latest

# Install Python, pip, ffmpeg, and bash dependencies
RUN apk add --no-cache python3 py3-pip ffmpeg bash

WORKDIR /app

# Configure a virtual environment to safely install python packages
RUN python3 -m venv /app/venv
ENV PATH="/app/venv/bin:$PATH"

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

# Copy application scripts
COPY bot.py .
COPY entrypoint.sh .
COPY cookies.txt* .

# Fix script execution permissions and directory access for Hugging Face standard user
RUN chmod +x entrypoint.sh && chmod -R 777 /app

# Hugging Face strictly monitors port 7860
EXPOSE 7860

ENTRYPOINT ["/app/entrypoint.sh"]