-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
67 lines (53 loc) · 1.45 KB
/
Dockerfile
File metadata and controls
67 lines (53 loc) · 1.45 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Etapa base (comum a CPU e GPU)
FROM python:3.10-buster AS base
RUN apt-get update && apt-get install -y \
git \
tk \
tk-dev \
x11-xserver-utils \
ffmpeg \
pciutils \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /root_dir
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8501
ENV STREAMLIT_SERVER_HEADLESS=true
ENV PYTHONUNBUFFERED=1
CMD ["streamlit", "run", "./app/streamlit.py", "--server.maxUploadSize=2048"]
# ---------------------------
# Etapa para CPU
# ---------------------------
FROM base AS cpu
# Herda tudo da base - nada extra necessário
# ---------------------------
# Etapa para GPU
# ---------------------------
FROM nvidia/cuda:12.0.1-base-ubuntu22.04 AS gpu
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
python3.10 \
python3.10-venv \
python3-pip \
git \
tk \
tk-dev \
x11-xserver-utils \
ffmpeg \
pciutils \
python3-tk \
nvidia-cuda-toolkit \
libcudnn8 \
libcudnn8-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Define python3.10 como padrão
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
WORKDIR /root_dir
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8501
ENV STREAMLIT_SERVER_HEADLESS=true
ENV PYTHONUNBUFFERED=1
CMD ["streamlit", "run", "./app/streamlit.py", "--server.maxUploadSize=2048"]