Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +10 -7
Dockerfile
CHANGED
@@ -1,20 +1,23 @@
|
|
1 |
-
|
2 |
-
FROM python:3.10
|
3 |
|
4 |
# Set up user
|
5 |
RUN useradd -m -u 1000 user
|
6 |
USER user
|
7 |
ENV PATH="/home/user/.local/bin:$PATH"
|
8 |
|
9 |
-
# Set
|
10 |
WORKDIR /app
|
11 |
|
12 |
-
#
|
13 |
COPY --chown=user backend/requirements.txt ./requirements.txt
|
14 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
15 |
|
16 |
-
# Copy the
|
17 |
COPY --chown=user . .
|
18 |
|
19 |
-
#
|
|
|
|
|
|
|
20 |
CMD ["uvicorn", "backend.app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
1 |
+
FROM python:3.10-slim
|
|
|
2 |
|
3 |
# Set up user
|
4 |
RUN useradd -m -u 1000 user
|
5 |
USER user
|
6 |
ENV PATH="/home/user/.local/bin:$PATH"
|
7 |
|
8 |
+
# Set working directory
|
9 |
WORKDIR /app
|
10 |
|
11 |
+
# Upgrade pip and install requirements
|
12 |
COPY --chown=user backend/requirements.txt ./requirements.txt
|
13 |
+
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
|
14 |
|
15 |
+
# Copy the full project code (backend and data)
|
16 |
COPY --chown=user . .
|
17 |
|
18 |
+
# Expose default FastAPI port
|
19 |
+
EXPOSE 7860
|
20 |
+
|
21 |
+
# Run FastAPI app
|
22 |
CMD ["uvicorn", "backend.app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
23 |
+
|