-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
50 lines (36 loc) · 1.14 KB
/
Dockerfile
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
40
41
42
43
44
45
46
47
48
49
50
# app/Dockerfile
# Stage 1: Build Stage
FROM python:3.11-slim AS builder
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
git \
libhdf5-dev \
libfreetype6-dev \
libpng-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy only the requirements files
COPY requirements.txt .
COPY ml/requirements.txt ./ml/
RUN pip install --upgrade pip setuptools wheel \
&& pip install --no-cache-dir -r requirements.txt \
&& pip install --no-cache-dir -r ./ml/requirements.txt
# Stage 2: Final Stage
FROM python:3.11-slim
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
EXPOSE 8501
RUN apt-get update && apt-get install -y --no-install-recommends \
libhdf5-serial-dev \
libfreetype6-dev \
libpng-dev \
git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
COPY --from=builder /usr/local/bin /usr/local/bin
COPY . .
ENTRYPOINT ["streamlit", "run", "Overview.py", "--server.port=8501", "--server.address=0.0.0.0"]