我正在尝试部署一个在本地运行的应用程序docker compose
.
我遵循了文档:使用 heroku.yml 构建 Docker 镜像 https://devcenter.heroku.com/articles/build-docker-images-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: