Update Dockerfile
Browse files- Dockerfile +21 -22
Dockerfile
CHANGED
|
@@ -1,22 +1,21 @@
|
|
| 1 |
-
# Use Python 3.11
|
| 2 |
-
FROM python:3.11
|
| 3 |
-
|
| 4 |
-
# Set working directory to /code
|
| 5 |
-
WORKDIR /code
|
| 6 |
-
|
| 7 |
-
# Copy requirements and install
|
| 8 |
-
COPY
|
| 9 |
-
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 10 |
-
|
| 11 |
-
# Copy
|
| 12 |
-
COPY . /code
|
| 13 |
-
|
| 14 |
-
# Create a non-root user (Required for
|
| 15 |
-
RUN useradd -m -u 1000 user
|
| 16 |
-
USER user
|
| 17 |
-
ENV HOME=/home/user \
|
| 18 |
-
PATH=/home/user/.local/bin:$PATH
|
| 19 |
-
|
| 20 |
-
# Expose port
|
| 21 |
-
|
| 22 |
-
CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
# Use Python 3.11
|
| 2 |
+
FROM python:3.11
|
| 3 |
+
|
| 4 |
+
# Set working directory to /code
|
| 5 |
+
WORKDIR /code
|
| 6 |
+
|
| 7 |
+
# Copy requirements and install
|
| 8 |
+
COPY requirements.txt /code/requirements.txt
|
| 9 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 10 |
+
|
| 11 |
+
# --- FIX: Copy ALL files from the root to /code ---
|
| 12 |
+
COPY . /code
|
| 13 |
+
|
| 14 |
+
# Create a non-root user (Required for HF Security)
|
| 15 |
+
RUN useradd -m -u 1000 user
|
| 16 |
+
USER user
|
| 17 |
+
ENV HOME=/home/user \
|
| 18 |
+
PATH=/home/user/.local/bin:$PATH
|
| 19 |
+
|
| 20 |
+
# Expose port and run
|
| 21 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|