Spaces:
Sleeping
Sleeping
Commit
·
9686017
1
Parent(s):
675d7b4
docker
Browse files- Dockerfile +4 -9
Dockerfile
CHANGED
|
@@ -1,22 +1,17 @@
|
|
| 1 |
FROM python:3.9
|
| 2 |
|
| 3 |
-
# Create a user with home directory
|
| 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 |
# Copy and install dependencies
|
| 12 |
-
COPY
|
| 13 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 14 |
RUN pip install --no-cache-dir fastapi uvicorn python-multipart
|
| 15 |
|
| 16 |
-
# Copy app
|
| 17 |
-
COPY
|
| 18 |
|
| 19 |
-
# Expose
|
| 20 |
EXPOSE 7860
|
| 21 |
|
| 22 |
# Start the FastAPI server
|
|
|
|
| 1 |
FROM python:3.9
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
# Set working directory
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
# Copy and install dependencies
|
| 7 |
+
COPY requirements.txt .
|
| 8 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 9 |
RUN pip install --no-cache-dir fastapi uvicorn python-multipart
|
| 10 |
|
| 11 |
+
# Copy the rest of the app
|
| 12 |
+
COPY . .
|
| 13 |
|
| 14 |
+
# Expose port (HF Spaces expects 7860)
|
| 15 |
EXPOSE 7860
|
| 16 |
|
| 17 |
# Start the FastAPI server
|