generated from UCSD-E4E/python-repo-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (27 loc) · 1.02 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
FROM python:3.12-slim AS builder
# Install Poetry
ARG POETRY_VERSION=1.8
ENV POETRY_HOME=/opt/poetry
ENV POETRY_NO_INTERACTION=1
ENV POETRY_VIRTUALENVS_IN_PROJECT=1
ENV POETRY_VIRTUALENVS_CREATE=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Tell Poetry where to place its cache and virtual environment
ENV POETRY_CACHE_DIR=/opt/.cache
RUN pip install "poetry==${POETRY_VERSION}"
WORKDIR /app
COPY pyproject.toml poetry.lock /app/
RUN --mount=type=cache,target=/opt/.cache poetry install --no-root --without dev
COPY README.md /app/README.md
COPY label_studio_slack_reporter /app/label_studio_slack_reporter
RUN poetry install --only main
# Now let's build the runtime image from the builder.
# We'll just copy the env and the PATH reference.
FROM python:3.12-slim AS runtime
ENV VIRTUAL_ENV=/app/.venv
ENV PATH="/app/.venv/bin:$PATH"
ENV E4E_DOCKER=1
COPY --from=builder /app/.venv /app/.venv
COPY --from=builder /app/label_studio_slack_reporter /app/label_studio_slack_reporter
ENTRYPOINT ["label_studio_reporting_service"]