-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (25 loc) · 844 Bytes
/
Copy pathDockerfile
File metadata and controls
27 lines (25 loc) · 844 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
FROM python:3.12-slim AS base
ARG POETRY_VERSION=1.8.2
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_DEFAULT_TIMEOUT=100 \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_NO_CACHE_DIR=off \
POETRY_NO_INTERACTION=1 \
POETRY_HOME="/opt/poetry" \
POETRY_CACHE_DIR="/opt/.cache" \
POETRY_VIRTUALENVS_IN_PROJECT=true
ENV PATH="$POETRY_HOME/bin:${PATH}"
WORKDIR /app
FROM base AS build-venv
COPY pyproject.toml ./
RUN pip install poetry==${POETRY_VERSION} && \
poetry install --only=main --no-root --no-ansi
FROM base AS final
ENV PORT=80
EXPOSE ${PORT}
COPY --from=build-venv /app/.venv ./.venv
COPY . /app
ENTRYPOINT .venv/bin/streamlit run app.py --server.port=${PORT} --server.address=0.0.0.0
HEALTHCHECK --interval=30s --timeout=3s \
CMD curl --fail http://localhost:${PORT}/_stcore/health || exit 1