Description
Good afternoon. I wanted to ask about full-stack-fastapi-postgresql for several weeks now I can’t deploy, I went through several steps in windows 10 and docker is the latest version and stuck in the installation of poetry gives an error. (
Building backend
[+] Building 321.5s (7/11)
=> [internal] load build definition from backend.dockerfile 0.0s
=> => transferring dockerfile: 40B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/tiangolo/uvicorn-gunicorn-fastapi:python3.7 11.4s
=> [internal] load build context 0.1s
=> => transferring context: 4.37kB 0.1s
=> [1/7] FROM docker.io/tiangolo/uvicorn-gunicorn-fastapi:python3.7@sha256:f5770422a8875fe3d677e1bda724eeba332b53b0a348a9cdde854ba7136c66be 0.0s
=> CACHED [2/7] WORKDIR /app/ 0.0s
=> ERROR [3/7] RUN curl -sSL https://github.com/raw/python-poetry/poetry/master/get-poetry.py | POETRY_HOME=/opt/poetry python && cd /usr/local/bin && ln -s /opt/poetry/bin/poetry && poetry config 309.9s
[3/7] RUN curl -sSL https://github.com/raw/python-poetry/poetry/master/get-poetry.py | POETRY_HOME=/opt/poetry python && cd /usr/local/bin && ln -s /opt/poetry/bin/poetry && poetry config virtualenvs.crea
te false:
#6 309.8 Retrieving Poetry metadata
#6 309.8 Traceback (most recent call last):
#6 309.8 File "/usr/local/lib/python3.7/urllib/request.py", line 1350, in do_open
#6 309.8 encode_chunked=req.has_header('Transfer-encoding'))
#6 309.8 File "/usr/local/lib/python3.7/http/client.py", line 1281, in request
#6 309.8 self._send_request(method, url, body, headers, encode_chunked)
#6 309.8 File "/usr/local/lib/python3.7/http/client.py", line 1327, in _send_request
#6 309.8 self.endheaders(body, encode_chunked=encode_chunked)
#6 309.8 File "/usr/local/lib/python3.7/http/client.py", line 1276, in endheaders
#6 309.8 self._send_output(message_body, encode_chunked=encode_chunked)
#6 309.8 File "/usr/local/lib/python3.7/http/client.py", line 1036, in _send_output
#6 309.8 self.send(msg)
#6 309.8 File "/usr/local/lib/python3.7/http/client.py", line 976, in send
#6 309.8 self.connect()
#6 309.8 File "/usr/local/lib/python3.7/http/client.py", line 1451, in connect
#6 309.8 server_hostname=server_hostname)
#6 309.8 File "/usr/local/lib/python3.7/ssl.py", line 423, in wrap_socket
#6 309.8 session=session
#6 309.8 File "/usr/local/lib/python3.7/ssl.py", line 870, in _create
#6 309.8 self.do_handshake()
#6 309.8 File "/usr/local/lib/python3.7/ssl.py", line 1139, in do_handshake
#6 309.8 self._sslobj.do_handshake()
#6 309.8 OSError: [Errno 0] Error
#6 309.8
#6 309.8 During handling of the above exception, another exception occurred:
#6 309.8
#6 309.8 Traceback (most recent call last):
#6 309.8 File "", line 1118, in
#6 309.8 File "", line 1114, in main
#6 309.8 File "", line 352, in run
#6 309.8 File "", line 415, in get_version
#6 309.8 File "", line 1029, in _get
#6 309.8 File "/usr/local/lib/python3.7/urllib/request.py", line 222, in urlopen
#6 309.8 return opener.open(url, data, timeout)
#6 309.8 File "/usr/local/lib/python3.7/urllib/request.py", line 525, in open
#6 309.8 response = self._open(req, data)
#6 309.8 File "/usr/local/lib/python3.7/urllib/request.py", line 543, in _open
#6 309.8 '_open', req)
#6 309.8 File "/usr/local/lib/python3.7/urllib/request.py", line 503, in _call_chain
#6 309.8 result = func(*args)
#6 309.8 File "/usr/local/lib/python3.7/urllib/request.py", line 1393, in https_open
#6 309.8 context=self._context, check_hostname=self._check_hostname)
#6 309.8 File "/usr/local/lib/python3.7/urllib/request.py", line 1352, in do_open
#6 309.8 raise URLError(err)
#6 309.8 urllib.error.URLError: <urlopen error [Errno 0] Error>
executor failed running [/bin/sh -c curl -sSL https://github.com/raw/python-poetry/poetry/master/get-poetry.py | POETRY_HOME=/opt/poetry python && cd /usr/local/bin && ln -s /opt/poetry/bin/poetry && poetry
config virtualenvs.create false]: exit code: 1
ERROR: Service 'backend' failed to build : Build failed
I searched for an answer on the Internet and unfortunately did not find similar solutions to problems. In parallel, in macbookpro macOS 10.12.6, it also fails to deploy, it gives an error (
Bahrom-MacBook-Pro:edoru negmatov$ docker-compose up -d
ERROR: Invalid interpolation format for "networks" option in service "flower": "${TRAEFIK_PUBLIC_NETWORK?Variable not set}"
)
Docker 17.03.1 is installed in macOS. I ask you to direct me to the correct solution of the error.
Visual Studio Code Version: 1.65.2 (Universal)
Thanks for the help
Activity
duz-sg commentedon Jun 23, 2022
They had some breaking changes so you can try an old version:
https://github.com/raw/python-poetry/poetry/1.1/get-poetry.py |
robertop23 commentedon Aug 31, 2022
The poetry install process should be updated.
Files backend.dockerfile and celeryworker.dockerfile:
# Install Poetry RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python3 - ENV PATH="/opt/poetry/bin:$PATH" RUN poetry config virtualenvs.create false
negmatov commentedon Aug 31, 2022
rlziii commentedon Sep 1, 2022
To add some clarity to @robertop23's answer (which worked for me):
In both
backend/backend.dockerfile
andbackend/celeryworker.dockerfile
replace the following code blocks:With the following:
Fix poetry
realyashnag commentedon Dec 1, 2022
@rlziii 's solution works, the following snippet looks even cleaner.
Replace
in
/backend.dockerfile
andceleryworker.dockerfile
toprithviraj574 commentedon Jul 11, 2023
This is not working currently
robertop23 commentedon Jul 11, 2023
lamegaton commentedon Aug 27, 2023
The latest Poetry version (1.6.1) drops support for python 3.7, so if we want to use
tiangolo/uvicorn-gunicorn-fastapi:python3.7
, we need to editsamanehmoradilgr commentedon Oct 12, 2023
-Getting Peotry error for using https://github.com/tiangolo/full-stack-fastapi-postgresql
So, check VPN(for connection from Iran) and then replace below code to backend.dockerfile and celeryworker.dockerfile:
#Install Poetry
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry POETRY_VERSION=1.5.1 python &&
cd /usr/local/bin &&
ln -s /opt/poetry/bin/poetry &&
poetry config virtualenvs.create false
karthikrajgopal commentedon Jul 16, 2024
I was able to solve this issue with installing directly from pip:
If someone confirms if it works for them too, I will raise a PR