File size: 1,209 Bytes
38c7c65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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

# Use an official Python runtime as a parent image
# Using 3.8 based on TensorFlow 2.4 compatibility
FROM python:3.8-slim

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# Set work directory
WORKDIR /app

# Install system dependencies
# libgl1-mesa-glx is often needed for opencv (cv2)
# gcc and python3-dev are needed for building some python packages
RUN apt-get update && apt-get install -y \

    gcc \
    libgl1-mesa-glx \
    libglib2.0-0 \
    && rm -rf /var/lib/apt/lists/*

# Install python dependencies
COPY requirements.txt /app/
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt

# Copy project
COPY . /app/

# Collect static files
# RUN python manage.py collectstatic --noinput
# (Commented out because it might fail without proper static storage config, enables manual run if needed)

# Expose port 7860 (Hugging Face Default)
EXPOSE 7860

# Default command (overridden by Render/Docker Compose)
# Start both the web server and the telegram bot
# Copy and make the start script executable
COPY start.sh /app/
RUN chmod +x /app/start.sh

# Start using the script
CMD ["/app/start.sh"]