File size: 1,317 Bytes
93fe4f5 | 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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | # Use a lightweight Python image
FROM python:3.11-slim-bookworm
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=on \
TZ=Asia/Kolkata
# Set timezone and install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
aria2 \
ffmpeg \
procps \
wget \
gnupg \
ca-certificates \
tzdata \
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy requirements first to leverage Docker cache
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy application files
COPY . .
# Create required directories and set permissions
RUN mkdir -p /app/downloads /app/logs \
&& touch /app/logs/auth.log \
&& chmod -R 777 /app \
&& if [ -f "/app/authorized_users.json" ]; then chmod 777 /app/authorized_users.json; fi
# Copy and set permissions for entrypoint
COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
# Expose your app port (Flask, FastAPI, etc.)
EXPOSE 8080
# Set the entrypoint script
ENTRYPOINT ["/app/entrypoint.sh"]
# Start your bot or app
CMD ["python3", "noor.py"] |