Spaces:
Sleeping

File size: 595 Bytes
45e7ae0
 
4c0cabf
 
 
 
45e7ae0
 
8c2a169
45e7ae0
 
 
 
 
 
 
 
 
 
 
 
4c0cabf
 
45e7ae0
8c2a169
45e7ae0
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
FROM python:3.11-slim

# Set environment variables for Hugging Face
ENV PYTHONUNBUFFERED=1
ENV PORT=7860

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    build-essential \
    libpq-dev \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application code
COPY . .

# Hugging Face expects the app to run on port 7860
EXPOSE 7860

# Run the application
CMD ["sh", "-c", "uvicorn app.main:app --host 0.0.0.0 --port ${PORT}"]