File size: 685 Bytes
283fbc7
 
 
 
 
 
 
 
 
 
 
e7b1c28
 
 
 
 
283fbc7
 
 
 
e7b1c28
 
 
 
 
283fbc7
e7b1c28
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.10-slim

WORKDIR /app

# Copy requirements first for better caching
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application
COPY . /app/

# Make sure assets directory exists with proper permissions
RUN mkdir -p /app/assets/static && chmod -R 755 /app/assets

# Create necessary directory for HuggingFace Spaces
RUN mkdir -p /app/.huggingface

# Expose port
EXPOSE 8000

# Environment variables for HuggingFace Spaces
ENV GRADIO_ALLOW_FLAGGING=never \
    GRADIO_SERVER_NAME=0.0.0.0 \
    GRADIO_SERVER_PORT=8000

# Command to run the application
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]