Giter VIP home page Giter VIP logo

java-heroku-from-zero-to-hero's Introduction

Java project which can be deployed on Heroku

Local project location

Remote project location

Heroku step-by-step instruction

  • install heroku cli link
  • create and upload ssh keys link
  • check whether everything is ok (locally): mvn clean install && heroku local web
  • to login to heroku server, run in the command line heroku login (browser will be opened for further authorization)
  • to create a new app on heroku server, run in the command line heroku create, output should look like this:
Creating app... done, ⬢ young-garden-08016
https://young-garden-08016.herokuapp.com/ | https://git.heroku.com/young-garden-08016.git
  • look for the git remotes: git remote -v, output should look like this:
heroku  https://git.heroku.com/young-garden-08016.git (fetch)
heroku  https://git.heroku.com/young-garden-08016.git (push)
origin  https://github.com/alexr007/java-heroku-from-zero-to-hero.git (fetch)
origin  https://github.com/alexr007/java-heroku-from-zero-to-hero.git (push)
  • push your code to heroku git push heroku master

Adding heroku database:

  • go to heroku dashboard
  • click young-garden-08016 (your app name)
  • click Resources
  • in the add-ons type: Postgres
  • click Heroku Postgres
  • click Provision
  • click Heroku Postgres in the list below
  • go to Settings, look for Credentials (you can use them in your DataGrip)

Useful heroku command:

  • heroku ps
  • heroku open
  • heroku ps:scale web=1
  • heroku logs --tail

Pay your attention to

  • Procfile contents:
    • fully-qualified path to the main class
    • classpath declaration
  • pom.xml sections:
    • <packaging>jar
    • <pluginns>maven-dependency-plugin...

Note: be aware of Heroku env variables:

  • DATABASE_URL looks like postgres:...
  • JDBC_DATABASE_URL looks like jdbc:postgresql:...
  • PORT http port to listen

Links

  • Heroku official documentation in general: here
  • Heroku official documentation about JDBC connection: here
  • Heroku official github code: here
  • Baeldung link how to create runnable jar file: here

java-heroku-from-zero-to-hero's People

Contributors

djnzx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.