Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +9 -8
Dockerfile
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
-
# Set working directory
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
# 1. Install System Dependencies
|
|
@@ -13,6 +13,7 @@ RUN apt-get update && apt-get install -y \
|
|
| 13 |
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
|
| 15 |
# 2. Install Python Libraries
|
|
|
|
| 16 |
COPY requirements.txt .
|
| 17 |
RUN pip3 install --no-cache-dir -r requirements.txt
|
| 18 |
|
|
@@ -21,22 +22,22 @@ RUN python -m spacy download en_core_web_sm
|
|
| 21 |
RUN python -m nltk.downloader stopwords wordnet omw-1.4
|
| 22 |
|
| 23 |
# 4. Copy Application Code
|
|
|
|
| 24 |
COPY . .
|
| 25 |
|
| 26 |
# 5. Global Permissions Fix
|
| 27 |
-
#
|
| 28 |
-
# has full access to create the database and log files.
|
| 29 |
RUN chmod -R 777 /app
|
| 30 |
|
| 31 |
-
# 6. CONFIGURATION
|
| 32 |
-
# Force Streamlit to
|
| 33 |
ENV STREAMLIT_SERVER_PORT=7860
|
| 34 |
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
|
| 35 |
-
# Prevent Streamlit from trying to watch file changes (saves resources)
|
| 36 |
ENV STREAMLIT_SERVER_FILE_WATCHER_TYPE=none
|
| 37 |
|
| 38 |
-
# Expose the port
|
| 39 |
EXPOSE 7860
|
| 40 |
|
| 41 |
# 7. Start the App
|
| 42 |
-
|
|
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
# Set working directory to /app
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
# 1. Install System Dependencies
|
|
|
|
| 13 |
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
|
| 15 |
# 2. Install Python Libraries
|
| 16 |
+
# Copy requirements from root (since it's not in src)
|
| 17 |
COPY requirements.txt .
|
| 18 |
RUN pip3 install --no-cache-dir -r requirements.txt
|
| 19 |
|
|
|
|
| 22 |
RUN python -m nltk.downloader stopwords wordnet omw-1.4
|
| 23 |
|
| 24 |
# 4. Copy Application Code
|
| 25 |
+
# This copies the 'src' folder and everything else into /app
|
| 26 |
COPY . .
|
| 27 |
|
| 28 |
# 5. Global Permissions Fix
|
| 29 |
+
# This ensures HF user has write access to /app/src/chroma_db if it gets created there
|
|
|
|
| 30 |
RUN chmod -R 777 /app
|
| 31 |
|
| 32 |
+
# 6. CONFIGURATION
|
| 33 |
+
# Force Streamlit to use the correct port
|
| 34 |
ENV STREAMLIT_SERVER_PORT=7860
|
| 35 |
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
|
|
|
|
| 36 |
ENV STREAMLIT_SERVER_FILE_WATCHER_TYPE=none
|
| 37 |
|
| 38 |
+
# Expose the port
|
| 39 |
EXPOSE 7860
|
| 40 |
|
| 41 |
# 7. Start the App
|
| 42 |
+
# CRITICAL FIX: We tell Streamlit to run the file inside the 'src' folder
|
| 43 |
+
ENTRYPOINT ["streamlit", "run", "src/app.py"]
|