dragxd / Dockerfile
xdragxt's picture
Update Dockerfile
a5e182d verified
raw
history blame
1.17 kB
FROM python:3.10-slim
# Set timezone
ENV TZ=Asia/Kolkata
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Install required system packages
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 project files
COPY . .
# Avoid pip permission issues
ENV PIP_ROOT_USER_ACTION=ignore
# Install Python dependencies
RUN pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# (Optional) Skip or modify if installer.sh fails
RUN [ -f installer.sh ] && bash installer.sh || true
# Fix Git ownership warning
RUN git config --system --add safe.directory /app
# Set folder permissions
RUN mkdir -p /app/sessions /app/resources/auth /app/tmp /app/pdf && \
chmod -R 777 /app/sessions /app/resources /app/tmp /app/pdf
# Set PYTHONPATH
ENV PYTHONPATH="${PYTHONPATH}:/app"
# Copy entrypoint
COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
# Run the bot/server
CMD ["/app/entrypoint.sh"]