Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +20 -0
Dockerfile
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use Python base
|
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 work directory
|
10 |
+
WORKDIR /app
|
11 |
+
|
12 |
+
# Copy backend requirements and install
|
13 |
+
COPY --chown=user ./backend/requirements.txt ./backend/requirements.txt
|
14 |
+
RUN pip install --no-cache-dir -r ./backend/requirements.txt
|
15 |
+
|
16 |
+
# Copy whole project
|
17 |
+
COPY --chown=user . .
|
18 |
+
|
19 |
+
# Run FastAPI app
|
20 |
+
CMD ["uvicorn", "backend/app/main:app", "--host", "0.0.0.0", "--port", "7860"]
|