-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (22 loc) · 888 Bytes
/
Copy pathDockerfile
File metadata and controls
31 lines (22 loc) · 888 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
FROM python:3.9.18-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first to leverage Docker cache
COPY requirements.txt .
# Install Python packages with specific version constraints
RUN pip install --no-cache-dir --upgrade pip && \
# Install PyTorch separately with extended timeout
pip install --no-cache-dir --timeout 1000 torch==2.5.1 --extra-index-url https://download.pytorch.org/whl/cpu && \
# Install remaining requirements
pip install --no-cache-dir --timeout 1000 -r requirements.txt
# Copy the rest of the application
COPY . .
RUN mkdocs build
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV SERVER_URL=http://172.17.149.236/api
EXPOSE 8503
CMD ["streamlit", "run", "app.py", "--server.port=8503", "--server.address=0.0.0.0"]