-
Notifications
You must be signed in to change notification settings - Fork 233
/
Dockerfile.dev
62 lines (49 loc) · 1.65 KB
/
Dockerfile.dev
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
FROM ubuntu:22.04 AS base
# hadolint ignore=DL3005,DL3008
RUN apt-get update -qq \
# Make sure that all security updates are installed
&& apt-get dist-upgrade -y --no-install-recommends \
&& apt-get install -y --no-install-recommends \
python3 \
python3-venv \
python3-pip \
python3-dev \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 100 \
&& update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 100
FROM base AS python_builder
ARG POETRY_VERSION=1.8.2
# hadolint ignore=DL3008
RUN apt-get update -qq \
&& apt-get install -y --no-install-recommends \
curl \
&& apt-get autoremove -y
# install poetry
# keep this in sync with the version in pyproject.toml and Dockerfile
ENV POETRY_VERSION=$POETRY_VERSION
ENV PYTHONUNBUFFERED=1
ENV PYTHONIOENCODING="utf-8"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN curl -sSL https://install.python-poetry.org | python
ENV PATH="/root/.local/bin:/opt/venv/bin:${PATH}"
# install dependencies
COPY . /app/
WORKDIR /app
# hadolint ignore=SC1091,DL3013
# install dependencies and build wheels
RUN python -m venv /opt/venv && \
. /opt/venv/bin/activate && \
pip install --no-cache-dir -U pip && \
pip install --no-cache-dir wheel && \
poetry install --no-root --no-interaction
# build the Rasa SDK wheel and install it
# hadolint ignore=SC1091,DL3013
RUN poetry build -f wheel -n && \
pip install --no-deps dist/*.whl && \
rm -rf dist *.egg-info
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& rm -rf /root/.cache/pip/*
EXPOSE 5055
ENTRYPOINT [""]