List item
I am trying to deploy a node - react app on heroku
If you are deploying your app as a node.js application you can run into this issue. Create your heroku app using the create-react-app buildpack:
https://elements.heroku.com/buildpacks/mars/create-react-app-buildpack
Hope this helps!
A 503 error code means the server cannot handle the request because it is either unresponsive or overloaded, as stated on MDN. This could be a result of incorrectly initializing the application on Heroku. Run the following in your directory from the terminal to deploy to heroku.
cd my-project
git init
heroku git:remote -a app-name
git add .
git commit -am "comment"
git push heroku master
More details about deploying a Node app to Heroku can be found here
Related
hello I'm trying to build my project for Heroku
I use React.js, Node.js and MongoDB
when I write those commands :
heroku login
git init
heroku git:remote -a whatsapp-clone5
git add .
git commit -am "make it better"
git push heroku main
This error appears to me
Heroku is likely not recognising the type of application you are pushing. Output of $ heroku logs would help diagnose the issue.
You might need to manually configure the buildpack
I'm trying to push my back-end and front-end with git push heroku HEAD:master and getting such error:
What causes this error?
Here you can check my package.json file:
I type:
git push heroku master
and I get:
The file package.json is present here
I've tried:
heroku buildpacks:set heroku/nodejs
And I still get the error.
This is the repo branch.
git push heroku [local branch name]:master
If I don't specify the local branch name. Heroku will automatically deploy from local master. That branch doesn't have a package.json file. That's why I got the error.
I have a nodejs express app serving a site. I deployed it with Heroku, using buildpack/nodejs and Github. Every time i push on Github, Heroku detects the push and runs the npm start script.
The problem is that I need to pass to a Docker image containing the nodejs app. I did it and it works locally, I can run it with docker run -d -p 8000:8000 exporter and it works.
I added the docker.yml file on the root folder and pushed on Github. But heroku still runs the npm script in the package.json, ignoring the docker.yml.
Is there a way to make heroku create the container from the Dockerfile every time I push to Github?
For Heroku to understand your heroku.yml file you need a few things.
First off you need to make sure that the Dockerfile is in the root directory.
Second, you need to ensure you are building and running the docker environment.
Finally, make sure you set your heroku stack to docker.
So, given that we want to ensure the directory tree looks like this:
|-my_app
|-app_contents
|-Dockerfile
|-heroku.yml
|-etc...
And that the heroku.yml file looks something like this:
build:
docker:
web: Dockerfile
run:
web: docker run -d -p 8000:8000 exporte
and finally run this in your heroku repo:
heroku stack:set container
Then just make sure you push your changes up.
If this doesn't help. I would recommend updating your post with the following:
The file tree
The Dockerfile
The heroku.yml file
Thanks to the answer of Taylor Cochran I managed to solve the problem.
I first tried to follow this link: https://devcenter.heroku.com/articles/container-registry-and-runtime
It worked but I had to do it from the cli.
After that I removed the entire project and remade it. I followed the indications of Taylor Cochran and pushed from heroku cli. I saw it worked and I then added the github deploy. And now every time I push on Github the new Docker container is automatically built and deployed by Heroku.
NB: I changed web: docker run -d -p 8000:8000 exporter to npm start
I've an application NodeJS and I would like to run it on Heroku.
I use the docker CLI with these command :
docker build -t registry.heroku.com/my-app/web .
docker login --username=_ --password=MYTOKEN registry.heroku.com
docker push registry.heroku.com/my-app/web
All of these commands are running good but my app is not released on heroku.
What is wrong ? Why my app is not released on heroku ?
I cannot use the heroku CLI.
The Heroku Container Runtime won't release images on docker push. That action is required, but only to upload images on the Heroku Platform.
You need to use the heroku container:release command, or the Heroku API to release those new images on your app.
See the Heroku Documentation about releasing docker images.