From f3823edaed64eead61f2679406727a55eeb8d734 Mon Sep 17 00:00:00 2001 From: little7Li <45064840+little7Li@users.noreply.github.com> Date: Wed, 15 Nov 2023 04:14:19 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Poetry=20installation=20in?= =?UTF-8?q?=20Dockerfile=20and=20upgrade=20Python=20version=20and=20packag?= =?UTF-8?q?es=20to=20fix=20Docker=20build=20(#480)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: lidong293 Co-authored-by: Sebastián Ramírez --- {{cookiecutter.project_slug}}/backend/app/pyproject.toml | 8 ++++---- {{cookiecutter.project_slug}}/backend/backend.dockerfile | 6 +++--- .../backend/celeryworker.dockerfile | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/{{cookiecutter.project_slug}}/backend/app/pyproject.toml b/{{cookiecutter.project_slug}}/backend/app/pyproject.toml index ea4e04e..3c9a0c5 100644 --- a/{{cookiecutter.project_slug}}/backend/app/pyproject.toml +++ b/{{cookiecutter.project_slug}}/backend/app/pyproject.toml @@ -5,8 +5,8 @@ description = "" authors = ["Admin "] [tool.poetry.dependencies] -python = "^3.7" -uvicorn = "^0.11.3" +python = "^3.8" +uvicorn = ">=0.24.0.post1" fastapi = "^0.54.1" python-multipart = "^0.0.5" email-validator = "^1.0.5" @@ -26,8 +26,8 @@ pytest = "^5.4.1" python-jose = {extras = ["cryptography"], version = "^3.1.0"} [tool.poetry.dev-dependencies] -mypy = "^0.770" -black = "^19.10b0" +mypy = ">=1.7.0" +black = ">=23.11.0" isort = "^4.3.21" autoflake = "^1.3.1" flake8 = "^3.7.9" diff --git a/{{cookiecutter.project_slug}}/backend/backend.dockerfile b/{{cookiecutter.project_slug}}/backend/backend.dockerfile index 8c39c50..88c1bc0 100644 --- a/{{cookiecutter.project_slug}}/backend/backend.dockerfile +++ b/{{cookiecutter.project_slug}}/backend/backend.dockerfile @@ -1,9 +1,9 @@ -FROM tiangolo/uvicorn-gunicorn-fastapi:python3.7 +FROM tiangolo/uvicorn-gunicorn-fastapi:python3.8 WORKDIR /app/ # Install Poetry -RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | POETRY_HOME=/opt/poetry python && \ +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 @@ -13,7 +13,7 @@ COPY ./app/pyproject.toml ./app/poetry.lock* /app/ # Allow installing dev dependencies to run tests ARG INSTALL_DEV=false -RUN bash -c "if [ $INSTALL_DEV == 'true' ] ; then poetry install --no-root ; else poetry install --no-root --no-dev ; fi" +RUN bash -c "if [ $INSTALL_DEV == 'true' ] ; then poetry install --no-root ; else poetry install --no-root --only main ; fi" # For development, Jupyter remote kernel, Hydrogen # Using inside the container: diff --git a/{{cookiecutter.project_slug}}/backend/celeryworker.dockerfile b/{{cookiecutter.project_slug}}/backend/celeryworker.dockerfile index 4695a7b..5e9d9ce 100644 --- a/{{cookiecutter.project_slug}}/backend/celeryworker.dockerfile +++ b/{{cookiecutter.project_slug}}/backend/celeryworker.dockerfile @@ -1,9 +1,9 @@ -FROM python:3.7 +FROM python:3.8 WORKDIR /app/ # Install Poetry -RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | POETRY_HOME=/opt/poetry python && \ +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 @@ -13,7 +13,7 @@ COPY ./app/pyproject.toml ./app/poetry.lock* /app/ # Allow installing dev dependencies to run tests ARG INSTALL_DEV=false -RUN bash -c "if [ $INSTALL_DEV == 'true' ] ; then poetry install --no-root ; else poetry install --no-root --no-dev ; fi" +RUN bash -c "if [ $INSTALL_DEV == 'true' ] ; then poetry install --no-root ; else poetry install --no-root --only main ; fi" # For development, Jupyter remote kernel, Hydrogen # Using inside the container: