File size: 729 Bytes
77e074a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7eaa122
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.9-slim

# Create a non-root user
RUN useradd -m -u 1000 user

# Switch to the new user
USER user

# Set home to the user's home directory and update PATH
ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH

# Set the working directory
WORKDIR $HOME/app

# Install dependencies
COPY --chown=user backend/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the application code
COPY --chown=user . .

# Set the working directory to the backend
WORKDIR $HOME/app/backend

# Expose the port the app runs on
EXPOSE 7860

# Run the application
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]