File size: 1,192 Bytes
76be54d
 
 
 
 
 
 
 
 
22546e3
 
 
 
76be54d
 
 
 
 
 
 
cb5c3f1
 
 
76be54d
 
 
 
5999508
22546e3
 
 
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
# Use an official Python runtime as a parent image
FROM python:3.10-slim

# Set the working directory in the container
WORKDIR /app

# Copy the requirements file into the container at /app
COPY requirements.txt .

# Install any needed system dependencies (if any - bs4, requests usually don't need much)
# RUN apt-get update && apt-get install -y --no-install-recommends some-package && rm -rf /var/lib/apt/lists/*
# For this bot, we likely don't need extra apt packages currently.

# Install Python dependencies
# Using --no-cache-dir reduces image size slightly
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application code into the container at /app
COPY . .

# Make port 7860 available to the world outside this container
# Hugging Face Spaces typically expect apps to run on port 7860
EXPOSE 7860

# Define environment variable to ensure Python output is sent straight to logs
ENV PYTHONUNBUFFERED=1

# Command to run the application using Gunicorn
# It will run the Flask 'app' object found in the 'main' module (main.py)
# Listen on all interfaces (0.0.0.0) on the port specified by HF (usually 7860)
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "main:app"]