File size: 1,217 Bytes
462a607
 
 
 
 
1db76ed
462a607
 
 
 
 
 
 
 
 
 
1db76ed
462a607
 
1db76ed
462a607
 
1db76ed
462a607
 
1db76ed
 
 
4874a6d
462a607
1db76ed
 
462a607
1db76ed
 
462a607
 
1db76ed
 
 
 
462a607
1db76ed
462a607
 
1db76ed
4874a6d
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
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