-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (26 loc) · 1.1 KB
/
Copy pathDockerfile
File metadata and controls
34 lines (26 loc) · 1.1 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
FROM python:3.12-slim
WORKDIR /app
# Install dependencies first so this layer is cached when only app code changes.
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy the application.
COPY app.py README.md LICENSE PRIVACY.md SECURITY.md CHANGELOG.md ./
COPY src/ ./src/
COPY examples/ ./examples/
COPY docs/ ./docs/
COPY assets/ ./assets/
COPY .streamlit/config.toml ./.streamlit/config.toml
# Make the computation package importable without an editable install.
# The system Arrow allocator avoids mimalloc segfaults seen on some platforms.
ENV PYTHONPATH=/app/src \
ARROW_DEFAULT_MEMORY_POOL=system
# The application does not need root privileges at runtime.
RUN useradd --create-home --uid 10001 worthsignal
USER worthsignal
EXPOSE 8501
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8501/_stcore/health', timeout=2)"
ENTRYPOINT ["streamlit", "run", "app.py", \
"--server.address", "0.0.0.0", \
"--server.port", "8501", \
"--browser.gatherUsageStats", "false"]