gpt4 book ai didi

docker - 使用 heroku.yml 部署到 Heroku 多个 docker 镜像,收到错误 : No default language could be detected for this app

转载 作者:行者123 更新时间:2023-12-02 19:44:42 25 4
gpt4 key购买 nike

我正在尝试部署一个使用 docker compose 在本地运行的应用程序。

我遵循了文档:Building Docker Images with heroku.yml并将 heroku.yml 添加到 git,然后推送到 heroku

git push heroku master

构建失败并出现以下错误:

Enumerating objects: 6611, done.
Counting objects: 100% (6611/6611), done.
Delta compression using up to 4 threads
Compressing objects: 100% (6417/6417), done.
Writing objects: 100% (6611/6611), 41.00 MiB | 244.00 KiB/s, done.
Total 6611 (delta 4657), reused 205 (delta 115)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: ! No default language could be detected for this app.
remote: HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
remote: See https://devcenter.heroku.com/articles/buildpacks
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to my-app.
remote:
To https://git.heroku.com/my-app.git
! [remote rejected] master -> master (pre-receive hook declined)

如何解决这个问题,为什么会这样?

heroku 甚至运行 yml 吗?

// heroku.yml

setup:
addons:
- plan: heroku-postgresql
as: DATABASE
config:
// .env vars
build:
docker:
web_server: web/server/dockerfile
web_client: web/client/dockerfile
ipfs: ipfs/dockerfile
blockchain: blockchain/dockerfile
config:
// .env vars
// docker-compose.yml

version: '3.8'
services:
ipfs:
container_name: $IPFS_CONTAINER_NAME
build: ./ipfs
blockchain:
container_name: $BLOCKCHAIN_CONTAINER_NAME
build:
context: ./blockchain
dockerfile: dockerfile
args:
- GETH_ACCOUNT_PASSWORD=$GETH_ACCOUNT_PASSWORD
- GETH_NETWORK_ID=$GETH_NETWORK_ID
env_file:
- ./.env
volumes:
- type: volume
source: blockchain_data
target: /usr/src/app/chain
db:
container_name: $DB_CONTAINER_NAME
image: postgres
env_file:
- ./.env
environment:
- POSTGRES_USER=$DB_SUPER_USER
- POSTGRES_PASSWORD=$DB_SUPER_PASSWORD
- POSTGRES_DB=$DB_NAME
ports:
- $DB_PORT_MAP
web_server:
container_name: $WEB_SERVER_CONTAINER_NAME
build: ./web/server
env_file:
- ./.env
ports:
- $WEB_SERVER_PORT:$WEB_SERVER_PORT
volumes:
- type: volume
source: blockchain_data
target: /usr/src/app/ipc
- type: bind
source: ./web/server/src
target: /usr/src/app/src
read_only: true
entrypoint: ["bash", "entrypoint.sh", $ENABLE_RLS_TOGGLE, $DB_ENABLE_RLS]
web_client:
container_name: $WEB_CLIENT_CONTAINER_NAME
build: ./web/client
env_file:
- ./.env
ports:
- $WEB_CLIENT_PORT:$WEB_CLIENT_PORT
volumes:
- type: bind
source: ./web/client/src
target: /usr/src/app/src
read_only: true
volumes:
blockchain_data:

最佳答案

有两个问题:

  1. 我再次查看了文档,发现我跳过了一个命令heroku stack:设置容器

  2. 运行 git push heroku master 将本地 master 推送到远程 master,而本地 master 没有 heroku.yml。我试图将本地分支推送到远程主机,正确的命令是:git push heroku my-branch:master

关于docker - 使用 heroku.yml 部署到 Heroku 多个 docker 镜像,收到错误 : No default language could be detected for this app,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64259434/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com