-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathDockerfile
47 lines (37 loc) · 1.39 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
# this base image seems to be quite similar to the streamlit cloud environment
FROM python:3.11-slim-bullseye
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_DEFAULT_TIMEOUT=120 \
LC_ALL=C.UTF-8 \
LANG=C.UTF-8
# we need some build tools for installing additional python pip packages
RUN apt-get update \
&& apt-get install --yes \
software-properties-common \
build-essential \
gcc \
g++ \
cmake \
git \
curl \
python3-dev
WORKDIR /app
# if we have a packages.txt, install it
COPY packages.txt packages.txt
RUN xargs -a packages.txt apt-get install --yes
RUN pip install --no-cache-dir --upgrade pip setuptools wheel uv
COPY requirements.txt requirements.txt
RUN uv pip install --system --no-cache -r requirements.txt
EXPOSE 8501
HEALTHCHECK --interval=1m --timeout=20s \
CMD curl --fail http://localhost:8501/_stcore/health
COPY . .
CMD ["streamlit", "run", "streamlit_app.py"]
# docker build --progress=plain --tag streamlit-selenium:latest .
# docker run -ti -p 8501:8501 --rm streamlit-selenium:latest /bin/bash
# docker run -ti -p 8501:8501 --rm streamlit-selenium:latest
# docker run -ti -p 8501:8501 -v ${pwd}:/app --rm streamlit-selenium:latest
# docker run -ti -p 8501:8501 -v ${pwd}:/app --rm streamlit-selenium:latest /bin/bash