-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (28 loc) · 941 Bytes
/
Copy pathDockerfile
File metadata and controls
39 lines (28 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# ---------- Builder ----------
FROM python:3.11-slim AS builder
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
gcc \
g++ \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --user -r requirements.txt
# ---------- Runtime ----------
FROM python:3.11-slim AS runtime
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PATH=/root/.local/bin:$PATH \
PORT=8501
WORKDIR /app
COPY --from=builder /root/.local /root/.local
COPY . .
RUN mkdir -p data/uploads data/vectorstore data/cache data/feedback logs
EXPOSE 8501 8000
# Default: launch the Streamlit UI. Override CMD to run the API instead.
CMD ["streamlit", "run", "app/streamlit_app.py", \
"--server.port=8501", "--server.address=0.0.0.0"]