Spaces:
Sleeping
Sleeping
Done
Browse files- Dockerfile +8 -14
Dockerfile
CHANGED
@@ -1,19 +1,13 @@
|
|
1 |
FROM python:3.11.10-bookworm
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
# Copy the requirements file to the working directory
|
7 |
-
COPY requirements.txt .
|
8 |
|
9 |
-
|
10 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
11 |
-
|
12 |
-
# Copy the rest of the app's code to the working directory
|
13 |
-
COPY . .
|
14 |
|
15 |
-
|
16 |
-
|
17 |
|
18 |
-
|
19 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "5000"]
|
|
|
1 |
FROM python:3.11.10-bookworm
|
2 |
|
3 |
+
RUN useradd -m -u 1000 user
|
4 |
+
USER user
|
5 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
|
|
|
|
6 |
|
7 |
+
WORKDIR /app
|
|
|
|
|
|
|
|
|
8 |
|
9 |
+
COPY --chown=user ./requirements.txt requirements.txt
|
10 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
11 |
|
12 |
+
COPY --chown=user . /app
|
13 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "5000"]
|