Hello! I’m trying to deploy a django app to fly, and it seems like there are some issues with requirements
requirements.txt:
aniso8601==9.0.1
asgiref==3.8.1
authtools==0.0.3
bcrypt==3.2.0
blinker==1.7.0
certifi==2024.2.2
cffi==1.16.0
chardet==4.0.0
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.4
cryptography==42.0.5
defusedxml==0.7.1
dill==0.3.8
distlib==0.3.8
distro==1.7.0
Django==5.0.3
django-allauth==0.61.1
django-authtools==2.0.1
django-betterforms==2.0.0
fasteners==0.14.1
filelock==3.13.1
Flask==3.0.2
Flask-RESTful==0.3.10
future==0.18.2
httplib2==0.20.2
idna==3.6
importlib-metadata==4.6.4
isodate==0.6.1
itsdangerous==2.1.2
jeepney==0.7.1
Jinja2==3.1.3
keyring==23.5.0
launchpadlib==1.10.16
lazr.restfulclient==0.14.4
lazr.uri==1.0.6
lockfile==0.12.2
macaroonbakery==1.3.1
Mako==1.1.3
MarkupSafe==2.1.5
monotonic==1.6
more-itertools==8.10.0
mssql-django==1.4.2
multiprocess==0.70.16
oauthlib==3.2.2
olefile==0.46
paramiko==2.9.3
pexpect==4.8.0
pillow==10.2.0
platformdirs==4.2.0
protobuf==3.12.4
ptyprocess==0.7.0
pycparser==2.22
PyJWT==2.8.0
pymacaroons==0.13.0
PyNaCl==1.5.0
pyodbc==5.1.0
pyparsing==2.4.7
pyRFC3339==1.1
python-dateutil==2.8.1
python-dotenv==1.0.1
python3-openid==3.2.0
pytz==2024.1
pyxdg==0.27
rdflib==7.0.0
requests==2.31.0
requests-oauthlib==2.0.0
SecretStorage==3.3.1
six==1.16.0
SPARQLWrapper==2.0.0
sqlparse==0.4.4
typing_extensions==4.5.0
tzdata==2024.1
urllib3==2.2.1
virtualenv==20.25.0
wadllib==1.3.6
Werkzeug==3.0.1
xdg==5
zipp==1.0.0
fly.toml:
# fly.toml app configuration file generated for djangokbin on 2024-04-17T22:43:49+02:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#
app = 'djangokbin'
primary_region = 'mad'
console_command = '/code/manage.py shell'
[build]
[env]
PORT = '8000'
[http_service]
internal_port = 8000
force_https = true
auto_stop_machines = false
auto_start_machines = true
min_machines_running = 0
processes = ['app']
[[vm]]
memory = '1gb'
cpu_kind = 'shared'
cpus = 1
Dokerfile:
ARG PYTHON_VERSION=3.12-slim-bullseye
FROM python:${PYTHON_VERSION}
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
RUN mkdir -p /code
WORKDIR /code
COPY requirements.txt /tmp/requirements.txt
RUN set -ex && \
pip install --upgrade pip && \
pip install -r /tmp/requirements.txt && \
rm -rf /root/.cache/
COPY . /code
EXPOSE 8000
CMD ["gunicorn", "--bind", ":8000", "--workers", "2", "webPage.wsgi"]
console output:
=> ERROR [5/6] RUN set -ex && pip install --upgrade pip && pip install -r /tmp/requirements.txt && rm -rf /root/.cac 11.4s
------
> [5/6] RUN set -ex && pip install --upgrade pip && pip install -r /tmp/requirements.txt && rm -rf /root/.cache/:
0.124 + pip install --upgrade pip
1.773 Requirement already satisfied: pip in /usr/local/lib/python3.12/site-packages (24.0)
1.923 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
2.074 + pip install -r /tmp/requirements.txt
3.814 Collecting aniso8601==9.0.1 (from -r /tmp/requirements.txt (line 1))
3.816 WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f75a7ffd5b0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /packages/e3/04/e97c12dc034791d7b504860acfcdd2963fa21ae61eaca1c9d31245f812c3/aniso8601-9.0.1-py2.py3-none-any.whl.metadata
4.318 WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f75a7ffec30>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /packages/e3/04/e97c12dc034791d7b504860acfcdd2963fa21ae61eaca1c9d31245f812c3/aniso8601-9.0.1-py2.py3-none-any.whl.metadata
5.320 WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f75a7ffff20>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /packages/e3/04/e97c12dc034791d7b504860acfcdd2963fa21ae61eaca1c9d31245f812c3/aniso8601-9.0.1-py2.py3-none-any.whl.metadata
7.321 WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f75a8311670>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /packages/e3/04/e97c12dc034791d7b504860acfcdd2963fa21ae61eaca1c9d31245f812c3/aniso8601-9.0.1-py2.py3-none-any.whl.metadata
11.32 WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f75a80901d0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /packages/e3/04/e97c12dc034791d7b504860acfcdd2963fa21ae61eaca1c9d31245f812c3/aniso8601-9.0.1-py2.py3-none-any.whl.metadata
11.32 ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/e3/04/e97c12dc034791d7b504860acfcdd2963fa21ae61eaca1c9d31245f812c3/aniso8601-9.0.1-py2.py3-none-any.whl.metadata (Caused by NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f75a80903e0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))
11.32
------
Error: failed to fetch an image or build from source: error building: failed to solve: process "/bin/sh -c set -ex && pip install --upgrade pip && pip install -r /tmp/requirements.txt && rm -rf /root/.cache/" did not complete successfully: exit code: 1
fly deploy --local-only works fine
Thanks!