Update Dockerfile
Browse files- Dockerfile +7 -11
Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
# Use
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
# Environment settings
|
|
@@ -7,18 +7,14 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
| 7 |
TRANSFORMERS_CACHE=/tmp/huggingface \
|
| 8 |
HF_HOME=/tmp/huggingface
|
| 9 |
|
| 10 |
-
# Create
|
| 11 |
RUN mkdir -p /tmp/huggingface /app/data /app/vectorstore
|
| 12 |
WORKDIR /app
|
| 13 |
|
| 14 |
# Install OS dependencies
|
| 15 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 16 |
build-essential \
|
| 17 |
-
|
| 18 |
-
libsm6 \
|
| 19 |
-
libxext6 \
|
| 20 |
-
libxrender-dev \
|
| 21 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 22 |
|
| 23 |
# Install Python dependencies
|
| 24 |
COPY requirements.txt .
|
|
@@ -27,8 +23,8 @@ RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir -r re
|
|
| 27 |
# Copy application code
|
| 28 |
COPY . .
|
| 29 |
|
| 30 |
-
# Expose
|
| 31 |
-
EXPOSE 8501
|
| 32 |
|
| 33 |
-
# Run
|
| 34 |
-
CMD ["
|
|
|
|
| 1 |
+
# Use slim Python base image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
# Environment settings
|
|
|
|
| 7 |
TRANSFORMERS_CACHE=/tmp/huggingface \
|
| 8 |
HF_HOME=/tmp/huggingface
|
| 9 |
|
| 10 |
+
# Create directories
|
| 11 |
RUN mkdir -p /tmp/huggingface /app/data /app/vectorstore
|
| 12 |
WORKDIR /app
|
| 13 |
|
| 14 |
# Install OS dependencies
|
| 15 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 16 |
build-essential \
|
| 17 |
+
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
# Install Python dependencies
|
| 20 |
COPY requirements.txt .
|
|
|
|
| 23 |
# Copy application code
|
| 24 |
COPY . .
|
| 25 |
|
| 26 |
+
# Expose Streamlit port
|
| 27 |
+
EXPOSE 8501
|
| 28 |
|
| 29 |
+
# Run Streamlit with FastAPI proxy
|
| 30 |
+
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|