Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +31 -31
Dockerfile
CHANGED
|
@@ -1,32 +1,32 @@
|
|
| 1 |
-
# Use official Python 3.11 image
|
| 2 |
-
FROM python:3.11
|
| 3 |
-
|
| 4 |
-
# Set working directory inside the container
|
| 5 |
-
WORKDIR /code
|
| 6 |
-
|
| 7 |
-
# Copy requirements from the Backend folder
|
| 8 |
-
COPY ./
|
| 9 |
-
|
| 10 |
-
# Install dependencies
|
| 11 |
-
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 12 |
-
|
| 13 |
-
# Copy the Backend code into the container
|
| 14 |
-
COPY ./
|
| 15 |
-
|
| 16 |
-
# Create necessary directories for Docs and DB
|
| 17 |
-
RUN mkdir -p /code/app/Docs
|
| 18 |
-
RUN mkdir -p /code/app/chroma_db
|
| 19 |
-
|
| 20 |
-
# GRANT PERMISSIONS: Hugging Face runs as a non-root user (user 1000)
|
| 21 |
-
# We must allow it to write to these folders to save the database.
|
| 22 |
-
RUN chmod -R 777 /code/app/Docs
|
| 23 |
-
RUN chmod -R 777 /code/app/chroma_db
|
| 24 |
-
|
| 25 |
-
# Set working directory to the app folder
|
| 26 |
-
WORKDIR /code/app
|
| 27 |
-
|
| 28 |
-
# Expose port 7860 (Hugging Face default)
|
| 29 |
-
EXPOSE 7860
|
| 30 |
-
|
| 31 |
-
# Start the server on port 7860
|
| 32 |
CMD ["uvicorn", "Server:App", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
# Use official Python 3.11 image
|
| 2 |
+
FROM python:3.11
|
| 3 |
+
|
| 4 |
+
# Set working directory inside the container
|
| 5 |
+
WORKDIR /code
|
| 6 |
+
|
| 7 |
+
# Copy requirements from the Backend folder
|
| 8 |
+
COPY ./backend/requirements.txt /code/requirements.txt
|
| 9 |
+
|
| 10 |
+
# Install dependencies
|
| 11 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 12 |
+
|
| 13 |
+
# Copy the Backend code into the container
|
| 14 |
+
COPY ./backend /code/app
|
| 15 |
+
|
| 16 |
+
# Create necessary directories for Docs and DB
|
| 17 |
+
RUN mkdir -p /code/app/Docs
|
| 18 |
+
RUN mkdir -p /code/app/chroma_db
|
| 19 |
+
|
| 20 |
+
# GRANT PERMISSIONS: Hugging Face runs as a non-root user (user 1000)
|
| 21 |
+
# We must allow it to write to these folders to save the database.
|
| 22 |
+
RUN chmod -R 777 /code/app/Docs
|
| 23 |
+
RUN chmod -R 777 /code/app/chroma_db
|
| 24 |
+
|
| 25 |
+
# Set working directory to the app folder
|
| 26 |
+
WORKDIR /code/app
|
| 27 |
+
|
| 28 |
+
# Expose port 7860 (Hugging Face default)
|
| 29 |
+
EXPOSE 7860
|
| 30 |
+
|
| 31 |
+
# Start the server on port 7860
|
| 32 |
CMD ["uvicorn", "Server:App", "--host", "0.0.0.0", "--port", "7860"]
|