-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
43 lines (30 loc) · 875 Bytes
/
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
38
39
40
FROM python:3.10 as wheel_builder
RUN apt-get update && \
apt-get install -y build-essential libssl-dev python3-dev bzip2 xz-utils zlib1g libxml2-dev libxslt1-dev libpopt0
ENV POETRY_HOME /poetry
ENV POETRY_VERSION 1.2.0
RUN curl -sSL https://install.python-poetry.org | python3 -
COPY ./poetry.lock /pyproject.toml ./
RUN mkdir ./wheelhouse && \
$POETRY_HOME/bin/poetry export -o ./requirements.txt --with-credentials &&\
pip wheel \
-w /wheelhouse \
--progress-bar off \
--no-cache-dir \
--no-clean \
--require-hashes \
-r ./requirements.txt
FROM python:3.10
ENV PYTHONBUFFERED 1
RUN apt-get update && apt-get install -y gettext
COPY --from=wheel_builder ./wheelhouse/ /tmp/wheelhouse
RUN pip install\
--user \
--no-cache-dir\
--disable-pip-version-check\
--no-index\
/tmp/wheelhouse/* && \
rm -rf /tmp/wheelhouse
RUN mkdir -p /app
WORKDIR /app
COPY . .