Skip to content

Commit

Permalink
šŸ› Fix Poetry installation in Dockerfile and upgrade Python version anā€¦
Browse files Browse the repository at this point in the history
ā€¦d packages to fix Docker build (#480)

Co-authored-by: lidong293 <lidong310@jd.com>
Co-authored-by: SebastiƔn Ramƭrez <tiangolo@gmail.com>
  • Loading branch information
3 people committed Nov 14, 2023
1 parent 6c9f702 commit f3823ed
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions {{cookiecutter.project_slug}}/backend/app/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ description = ""
authors = ["Admin <admin@example.com>"]

[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"
Expand All @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions {{cookiecutter.project_slug}}/backend/backend.dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions {{cookiecutter.project_slug}}/backend/celeryworker.dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand Down

0 comments on commit f3823ed

Please sign in to comment.