heroku - Heroku 部署继续使用 nodejs 构建,而不是使用 heroku.yml
问题描述
在这里有点吃亏。这是我在日志中得到的:
C:\Users\tzahi\Documents\my-app>git push heroku heroku-fixes-and-repo-cleanup:master
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 343 bytes | 343.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpacks:
remote: 1. heroku/nodejs
remote: 2. https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git
remote: 3. https://github.com/appositum/heroku-buildpack-youtube-dl.git
remote: -----> Node.js app detected
如有必要,我可以发布完整的日志,但“检测到 Node.js 应用程序”似乎出错了。
这是我的根文件夹的样子(请注意,缺少 Procfile):
root
│--heroku.yml
│--Dockerfile.heroku
│--app.json
│--package.json
│ ...
应用程序.json:
{
"name": "my-app",
"description": "blah blah blah",
"repository": "https://github.com/Tzahi12345/my-app",
"stack": "container",
"logo": "https://i.imgur.com/GPzvPiU.png",
"keywords": ["youtube-dl", "youtubedl-material", "nodejs"]
}
heroku.yml:
build:
docker:
web: Dockerfile.heroku
run:
web: npm start
不确定这run
部分是否是必要的,但我暂时把它放在那里(这方面似乎没有太大变化)。
Dockerfile.heroku:
FROM tzahi12345/my-app:my-tag
我努力了:
"stack": "container"
从 app.json 中移除- 跑步
heroku set:stack container
- 从相关分支运行此部署链接:
https://heroku.com/deploy?template=https://github.com/Tzahi12345/my-app
- 向heroku众神祈祷
不知道我要去哪里错了。我假设如果我在根目录中有 heroku.yml 文件,"stack": "container"
它app.json
会检测到它是一个 Docker 容器并正确构建。任何想法/建议将不胜感激!谢谢 :)
编辑:
也许我应该清楚我的最终目标。我想让用户能够使用存储库中的链接部署应用程序,并让构建过程使用 heroku.yml ,如此处所述。
解决方案
推荐阅读
- stored-procedures - 实体框架核心数据库表值函数映射
- penetration-testing - POST 请求的 CSRF 检测,在服务器上进行内容类型验证
- amcharts - 减少 AmChart 构建大小
- azure - Azure Batch:如果作业失败发送电子邮件
- ios - 我想用带有动态行的动态部分制作 Utableview
- visual-c++ - 使用 vc++ 链接库时出现错误 LNK2005
- centos7 - 使用 soffice 将 doc 转换为 docx 不起作用
- c# - 在 Julia 中,多个点会强制计算相同的数组元素吗?
- sql-server - T-SQL - 两个日期的两个日期时间之间的每小时秒数
- dart - Flutter - Mockito 在尝试抛出自定义异常时表现得很奇怪