feat1
Browse files- Dockerfile +6 -5
Dockerfile
CHANGED
|
@@ -13,14 +13,15 @@ RUN apt-get update && apt-get install -y \
|
|
| 13 |
libpq-dev \
|
| 14 |
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
-
# Copy requirements
|
| 17 |
-
COPY requirements.txt .
|
| 18 |
|
| 19 |
# Install Python dependencies
|
| 20 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 21 |
|
| 22 |
-
# Copy the
|
| 23 |
-
|
|
|
|
| 24 |
|
| 25 |
# Switch to the non-root user
|
| 26 |
USER user
|
|
@@ -28,5 +29,5 @@ USER user
|
|
| 28 |
# Hugging Face Spaces route web traffic to port 7860
|
| 29 |
EXPOSE 7860
|
| 30 |
|
| 31 |
-
# Start the FastAPI server
|
| 32 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 13 |
libpq-dev \
|
| 14 |
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
+
# Copy the requirements file from the backend folder first
|
| 17 |
+
COPY keystone-backend/requirements.txt .
|
| 18 |
|
| 19 |
# Install Python dependencies
|
| 20 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 21 |
|
| 22 |
+
# Copy the contents of the backend folder into the container
|
| 23 |
+
# and assign ownership to the non-root user
|
| 24 |
+
COPY --chown=user:user keystone-backend/ .
|
| 25 |
|
| 26 |
# Switch to the non-root user
|
| 27 |
USER user
|
|
|
|
| 29 |
# Hugging Face Spaces route web traffic to port 7860
|
| 30 |
EXPOSE 7860
|
| 31 |
|
| 32 |
+
# Start the FastAPI server (it will run main.py from the copied backend files)
|
| 33 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|