TeraBot / Dockerfile
sanch1tx's picture
Upload 15 files
93fe4f5 verified
# 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"]