-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile.prebuilt
44 lines (37 loc) · 1.99 KB
/
Dockerfile.prebuilt
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
ARG PYTHON_VERSION="3.11"
###############################################################################
# 2. Install python connector dependencies
###############################################################################
# poetry setup code based on https://github.com/thehale/docker-python-poetry (does not provide multiarch images)
FROM python:${PYTHON_VERSION} AS build-python
ARG POETRY_VERSION="1.6.1"
ENV POETRY_VERSION=${POETRY_VERSION}
ENV POETRY_HOME="/opt/poetry"
ENV POETRY_VIRTUALENVS_IN_PROJECT=true
ENV POETRY_NO_INTERACTION=1
ENV PATH="$POETRY_HOME/bin:$PATH"
RUN apt-get update && apt-get install -y --no-install-recommends curl
# Install Poetry via the official installer: https://python-poetry.org/docs/master/#installing-with-the-official-installer
# This script respects $POETRY_VERSION & $POETRY_HOME
RUN curl -sSL https://install.python-poetry.org | python3 -
# only install dependencies into project virtualenv
WORKDIR /app
COPY bpm-ai-connectors-c8/pyproject.toml \
bpm-ai-connectors-c8/poetry.lock ./
RUN poetry install --only main --no-root --no-cache
###############################################################################
# 3. Final, minimal image that starts the connectors and feel engine process
###############################################################################
FROM python:${PYTHON_VERSION}-slim
ARG PYTHON_VERSION
ENV PYTHONUNBUFFERED=1
WORKDIR /app
COPY --chmod=755 ./feel-engine-wrapper/target/feel-engine-wrapper-runner feel-wrapper
COPY ./bpm-ai-connectors-c8/bpm_ai_connectors_c8/ ./bpm_ai_connectors_c8/
COPY --from=build-python /app/.venv/lib/python${PYTHON_VERSION}/site-packages /usr/local/lib/python${PYTHON_VERSION}/site-packages
RUN apt-get update \
&& apt-get install -y --no-install-recommends poppler-utils \
&& apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/*
# Run two processes: connector runtime + feel engine wrapper
COPY init.py .
CMD ["python3", "init.py", "./feel-wrapper", "python -m bpm_ai_connectors_c8.main"]