File size: 603 Bytes
b24168c
6e7ce30
 
 
 
b24168c
 
 
 
09b5e1f
 
 
 
b24168c
09b5e1f
6e7ce30
 
b24168c
09b5e1f
6e7ce30
b24168c
9373355
6e7ce30
b24168c
9373355
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

FROM python:3.11-slim

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*

# Create a non-root user for security
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"

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

# Copy the rest of the application
COPY --chown=user:user . .

# Standard OpenEnv port is 8000
EXPOSE 7860

# Start using uvicorn on port 8000
CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"]