Heroku Django Error R10 (Boot timeout) -> Веб-процессу не удалось привязаться к $PORT в течение 60 секунд после запуска
Я пытаюсь добавить Tailwind в мое веб-приложение Django, которое требует установки node.js. Приложение вроде бы собирается без ошибок в Heroku, но при запуске dyno возникает следующая ошибка:
2022-01-12T13:31:44.946174+00:00 app[web.1]: [heroku-exec] Starting
2022-01-12T13:32:43.574277+00:00 heroku[web.1]: Process exited with status 137
2022-01-12T13:32:43.700696+00:00 heroku[web.1]: State changed from starting to crashed
2022-01-12T13:32:43.126165+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2022-01-12T13:32:43.397665+00:00 heroku[web.1]: Stopping process with SIGKILL
Я следовал документации на https://django-tailwind.readthedocs.io/en/latest/. Кажется, что все работает, как ожидалось, в моей локальной среде, но не работает в производственной среде при развертывании на Heroku.
Я добавляю оба билдпака heroku/nodejs
и heroku/python
.
Procfile:
web: gunicorn card_companion_v2.wsgi --log-file -
package.json
{
"name": "theme",
"version": "3.0.0",
"description": "",
"scripts": {
"start": "npm run dev",
"build": "npm run build:clean && npm run build:tailwind",
"build:clean": "rimraf ../static/css/dist",
"build:tailwind": "cross-env NODE_ENV=production tailwindcss --postcss -i ./src/styles.css -o ../static/css/dist/styles.css --minify",
"sync": "browser-sync start --config bs.config.js",
"dev:tailwind": "cross-env NODE_ENV=development tailwindcss --postcss -i ./src/styles.css -o ../static/css/dist/styles.css -w",
"dev:sync": "run-p dev:tailwind sync",
"dev": "nodemon -x \"npm run dev:sync\" -w tailwind.config.js -w postcss.config.js -w bs.config.js -e js",
"tailwindcss": "node ./node_modules/tailwindcss/lib/cli.js"
},
"keywords": [],
"author": "",
"license": "MIT",
"devDependencies": {
"@tailwindcss/aspect-ratio": "^0.4.0",
"@tailwindcss/forms": "^0.4.0",
"@tailwindcss/line-clamp": "^0.3.0",
"@tailwindcss/typography": "^0.5.0",
"browser-sync": "^2.27.7",
"cross-env": "^7.0.3",
"nodemon": "^2.0.15",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.4",
"postcss-cli": "^8.3.1",
"postcss-import": "^14.0.2",
"postcss-nested": "^5.0.6",
"postcss-simple-vars": "^6.0.3",
"rimraf": "^3.0.2",
"tailwindcss": "^3.0.0"
},
"engines": {
"node": "^16.13.2",
"npm": "^8.1.2"
}
}
Журналы сборки:
-----> Building on the Heroku-20 stack
-----> Using buildpacks:
1. heroku/nodejs
2. heroku/python
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_VERBOSE=false
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)
Resolving node version 14.x...
Downloading and installing node 14.18.3...
Using default npm version: 6.14.15
-----> Restoring cache
Loading 1 from cacheDirectories (package.json):
- theme/static_src/node_modules
-----> Installing dependencies
Installing node modules (package.json)
> card_companion-v2@1.0.0 postinstall /tmp/build_a15c6c87
> cd theme/static_src && npm install
audited 456 packages in 2.036s
63 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
up to date in 2.661s
found 0 vulnerabilities
-----> Build
-----> Caching build
Saving 1 cacheDirectories (package.json):
- theme/static_src/node_modules
-----> Pruning devDependencies
up to date in 0.219s
found 0 vulnerabilities
-----> Build succeeded!
-----> Python app detected
-----> Using Python version specified in runtime.txt
-----> No change in requirements detected, installing from cache
-----> Using cached install of python-3.10.1
-----> Installing pip 21.3.1, setuptools 57.5.0 and wheel 0.37.0
-----> Installing SQLite3
-----> Installing requirements with pip
-----> $ python manage.py collectstatic --noinput
10657 static files copied to '/tmp/build_a15c6c87/static', 30923 post-processed.
-----> Discovering process types
Procfile declares types -> web
-----> Compressing...
Done: 154.4M
-----> Launching...