Spaces:
Running
Running
Create Dockerfile
Browse files- Dockerfile +22 -0
Dockerfile
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use the latest Python image
|
2 |
+
FROM python:latest
|
3 |
+
|
4 |
+
# Create a user with UID 1000
|
5 |
+
RUN useradd -m -u 1000 user
|
6 |
+
USER user
|
7 |
+
|
8 |
+
# Set environment variable
|
9 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
10 |
+
|
11 |
+
# Set the working directory
|
12 |
+
WORKDIR /app
|
13 |
+
|
14 |
+
# Copy the requirements file and install dependencies
|
15 |
+
COPY --chown=user ./requirements.txt requirements.txt
|
16 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
17 |
+
|
18 |
+
# Copy the rest of the application files
|
19 |
+
COPY --chown=user . /app
|
20 |
+
|
21 |
+
# Command to run the FastAPI app with Uvicorn
|
22 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|