Commit 86dc3b0 1 parent 9ae9114 commit 86dc3b0 Copy full SHA for 86dc3b0
File tree 2 files changed +29
-4
lines changed
2 files changed +29
-4
lines changed Original file line number Diff line number Diff line change 24
24
uses : docker/build-push-action@v5
25
25
with :
26
26
push : true
27
- tags : botalovserg/test -docker:latest
27
+ tags : botalovserg/app-bot -docker:latest
Original file line number Diff line number Diff line change 1
- FROM python:3.11-slim-bullseye
1
+ FROM python:3.10 as python-base
2
+
3
+ # https://python-poetry.org/docs#ci-recommendations
4
+ ENV POETRY_VERSION=1.8.3
5
+ ENV POETRY_HOME=/opt/poetry
6
+ ENV POETRY_VENV=/opt/poetry-venv
7
+
8
+ # Tell Poetry where to place its cache and virtual environment
9
+ ENV POETRY_CACHE_DIR=/opt/.cache
10
+
11
+ # Create stage for Poetry installation
12
+ FROM python-base as poetry-base
13
+
14
+ # Creating a virtual environment just for poetry and install it with pip
15
+ RUN python3 -m venv $POETRY_VENV \
16
+ && $POETRY_VENV/bin/pip install -U pip setuptools \
17
+ && $POETRY_VENV/bin/pip install poetry==${POETRY_VERSION}
18
+
19
+ # Create a new stage from the base python image
20
+ FROM python:3.11-slim-bullseye as bot-app
21
+ COPY --from=poetry-base ${POETRY_VENV} ${POETRY_VENV}
2
22
ENV PYTHONDONTWRITEBYTECODE 1
3
23
ENV PYTHONUNBUFFERED 1
4
24
WORKDIR /app
5
- COPY requirements.txt .
6
- RUN pip install --no-cache -r /app/requirements.txt
25
+ # Copy Dependencies
26
+ COPY poetry.lock pyproject.toml ./
27
+
28
+ # [OPTIONAL] Validate the project is properly configured
29
+ RUN poetry check
30
+ # Install Dependencies
31
+ RUN poetry install --no-interaction --no-cache --without dev
7
32
COPY . /app
8
33
CMD ["python3" , "main.py" ]
You can’t perform that action at this time.
0 commit comments