-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (24 loc) · 810 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
FROM python:3.10-slim as base
# set env variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
RUN pip install -U pip \
&& apt-get update \
&& apt-get install -y curl build-essential
FROM base as poetry
ENV POETRY_VERSION=1.5.1 \
POETRY_HOME="/opt/poetry" \
POETRY_VIRTUALENVS_CREATE=true \
POETRY_VIRTUALENVS_IN_PROJECT=true
RUN curl -sSL https://install.python-poetry.org | POETRY_VERSION=${POETRY_VERSION} python3 -
ENV PATH="${POETRY_HOME}/bin:$PATH"
RUN poetry config virtualenvs.create ${POETRY_VIRTUALENVS_CREATE}
RUN poetry config virtualenvs.in-project ${POETRY_VIRTUALENVS_IN_PROJECT}
FROM poetry as build
WORKDIR /app
# copy project
COPY src ./src
# install dependencies POETRY
COPY pyproject.toml ./pyproject.toml
RUN poetry install
CMD ["python", "main.py"]