Update Dockerfile
Browse files- Dockerfile +13 -5
Dockerfile
CHANGED
|
@@ -1,14 +1,16 @@
|
|
| 1 |
-
FROM python:3.
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
|
| 5 |
|
| 6 |
-
# Install
|
|
|
|
|
|
|
|
|
|
| 7 |
COPY requirements.txt .
|
| 8 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 9 |
|
| 10 |
# Install Playwright and Browsers
|
| 11 |
-
#RUN playwright install --force
|
| 12 |
RUN pip install playwright && playwright install --with-deps chromium
|
| 13 |
|
| 14 |
# Copy app files
|
|
@@ -16,5 +18,11 @@ COPY . /app
|
|
| 16 |
WORKDIR /app
|
| 17 |
RUN chmod -R 755 /app
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
# Run the app
|
| 20 |
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
| 2 |
|
| 3 |
+
# Set environment variables
|
| 4 |
+
ENV PYTHONUNBUFFERED=1
|
| 5 |
|
| 6 |
+
# Install system dependencies
|
| 7 |
+
RUN apt-get update && apt-get install -y wget curl libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libxkbcommon0 libxcomposite1 libxrandr2 libasound2 libpangocairo-1.0-0 libxdamage1 libgbm1 libpango-1.0-0 libgtk-3-0 gcc
|
| 8 |
+
|
| 9 |
+
# Copy and install Python dependencies
|
| 10 |
COPY requirements.txt .
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
# Install Playwright and Browsers
|
|
|
|
| 14 |
RUN pip install playwright && playwright install --with-deps chromium
|
| 15 |
|
| 16 |
# Copy app files
|
|
|
|
| 18 |
WORKDIR /app
|
| 19 |
RUN chmod -R 755 /app
|
| 20 |
|
| 21 |
+
# Preload SentenceTransformer model to avoid runtime errors
|
| 22 |
+
RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')"
|
| 23 |
+
|
| 24 |
+
# Expose port (optional, for web apps)
|
| 25 |
+
EXPOSE 7860
|
| 26 |
+
|
| 27 |
# Run the app
|
| 28 |
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|