noam steiner
noam steiner

Reputation: 4444

Deploy to Heroku multiple docker images with heroku.yml, recieve the ERROR: No default language could be detected for this app

I'm trying to deploy an app that runs locally with docker compose.

I followed the docs: Building Docker Images with heroku.yml and add heroku.yml to git, then pushed to heroku

git push heroku master

The build fails with the following error:

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)

How to fix this, and why is this happening?

Does heroku even run the 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:

Upvotes: 4

Views: 3452

Answers (1)

noam steiner
noam steiner

Reputation: 4444

There was two issues:

  1. I looked the docs again and figured that I skipped a command heroku stack:set container

  2. running git push heroku master pushed local master to remote master, and the local master didn't have heroku.yml. I was trying to push a local branch to remote master, the correct command is: git push heroku my-branch:master

Upvotes: 3

Related Questions