FROM python:3.10-slim ENV TZ=Asia/Kolkata RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone # Install required system packages (fixed syntax) RUN apt-get update && apt-get install -y --no-install-recommends \ gdb \ git \ gcc \ python3-dev \ ffmpeg \ mediainfo \ neofetch && \ apt-get clean && rm -rf /var/lib/apt/lists/* # Set working directory WORKDIR /app # Copy all files to container COPY . . # Avoid pip install as root errors ENV PIP_ROOT_USER_ACTION=ignore # Upgrade pip and install Python requirements RUN pip install --upgrade pip RUN pip install --no-cache-dir -r requirements.txt RUN pip install uvicorn fastapi # Optional: Run installer if needed RUN bash installer.sh || true # Fix Git 'dubious ownership' issue safely RUN git config --system --add safe.directory /app # Ensure writable directories RUN mkdir -p /app/sessions && chmod -R 777 /app/sessions RUN mkdir -p /app/resources/auth && chmod -R 777 /app/resources RUN mkdir -p /app/tmp && chmod -R 777 /app/tmp RUN mkdir -p /app/pdf && chmod -R 777 /app/pdf # Set Python path explicitly ENV PYTHONPATH="${PYTHONPATH}:/app" # Start the bot CMD bash startup & python3 server.py