-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (25 loc) · 765 Bytes
/
Dockerfile
File metadata and controls
32 lines (25 loc) · 765 Bytes
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
# pull official base image
FROM python:3.10-slim-bookworm
# set work directory
WORKDIR /usr/src/app
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# install dependencies
RUN set -eux \
&& apt-get -y update \
&& apt-get -y upgrade \
&& apt-get -y install curl \
&& pip install --upgrade pip \
&& rm -rf /root/.cache/pip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python && \
cd /usr/local/bin && \
ln -s /opt/poetry/bin/poetry && \
poetry config virtualenvs.create false
# copy pyproject file
COPY ./pyproject.toml /usr/src/app/pyproject.toml
RUN poetry install
# copy project
COPY ./src /usr/src/app/