File size: 652 Bytes
4c76a6d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Use official Python 3.10 slim image
FROM python:3.10-slim

# Set working directory to /app
WORKDIR /app

# Copy requirements (relative to backend/ folder)
COPY requirements.txt requirements.txt

# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Copy the current directory contents (backend code) into /app
COPY . .

# Set permissions for Hugging Face (User 1000)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH

# Expose port 7860
EXPOSE 7860

# Run uvicorn (module is main:app since we are inside the folder)
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]