Spaces:
Sleeping
Sleeping
Commit
·
64e01a2
1
Parent(s):
5a52ee7
change docker6
Browse files- Dockerfile +12 -13
Dockerfile
CHANGED
@@ -3,20 +3,19 @@ FROM python:3.10-slim
|
|
3 |
# Set working directory
|
4 |
WORKDIR /app
|
5 |
|
6 |
-
# Copy
|
7 |
-
COPY .
|
8 |
-
|
9 |
-
# Install Python dependencies system-wide
|
10 |
-
RUN pip install --upgrade pip && pip install -r requirement.txt
|
11 |
-
|
12 |
-
# Create ChromaDB persistence directory
|
13 |
-
RUN mkdir -p /app/data_ingetion/chroma_storage
|
14 |
-
|
15 |
-
|
16 |
-
# Run FastAPI then Streamlit
|
17 |
-
CMD uvicorn main_api:app --host 0.0.0.0 --port 8000 & \
|
18 |
-
streamlit run streamlit_app/app.py --server.port 8501
|
19 |
|
|
|
|
|
20 |
|
|
|
|
|
21 |
|
|
|
|
|
|
|
|
|
22 |
|
|
|
|
|
|
3 |
# Set working directory
|
4 |
WORKDIR /app
|
5 |
|
6 |
+
# Copy the current directory contents into the container at /app
|
7 |
+
COPY . /app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
+
# Install any needed packages specified in requirements.txt
|
10 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
11 |
|
12 |
+
# Create a non-root user
|
13 |
+
RUN useradd -m appuser
|
14 |
|
15 |
+
# Create necessary directories and set permissions
|
16 |
+
RUN chown -R appuser:appuser /app && \
|
17 |
+
chmod -R 755 /app && \
|
18 |
+
mkdir -p /app/data_ingetion/chroma_storage
|
19 |
|
20 |
+
# Start the FastAPI app on port 7860, the default port expected by Spaces
|
21 |
+
CMD ["uvicorn", "main_app:app", "--host", "0.0.0.0", "--port", "7860"]
|