Coder Social home page Coder Social logo

heroku-buildpack-skinny's Introduction

Heroku Skinny Buildpack

This is a Heroku buildpack for the Skinny framework.

Usage

Install the Heroku Toolbelt and create a free Heroku account. Then login in with that account by running:

$ heroku login

Make sure you have a Git repo for you app. From the root of your project run:

$ git init
$ git add .
$ git commit -am "deploy to heroku"

Then create a Heroku app:

$ heroku create

Set this buildpack as the default buildpack:

$ heroku buildpacks:set https://github.com/jkutner/heroku-buildpack-skinny

And push your app to Heroku:

$ git push heroku master

The first deploy will take a long time because it must download all dependencies. But they will be cached, so the next deploy will be faster.

Database

The buildpack will automatically set up the connection URL for you, but you may need to include the PostgreSQL (or other vendor's) driver in your dependencies. Addd something like this to project/Build.scala:

libraryDependencies ++= Seq(
  "org.postgresql" % "postgresql" % "9.4-1201-jdbc41"
)

To run migrations, configure your src/main/resources/application.conf with something like this:

production {
  db {
    default {
      driver="org.postgresql.Driver"
      url=${?JDBC_DATABASE_URL}
    }
  }
}

You can get the value for $JDBC_DATABASE_URL by running heroku run echo \$JDBC_DATABASE_URL. Set that value locally, but add the arguments ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory, and then run:

./skinny db:migrate production default

Customizing

By default, the buildpack runs your app with a command like:

java $JAVA_OPTS -Dskinny.port=$PORT -Dskinny.env=production -Ddb.default.url=$JDBC_DATABASE_URL -Ddb.default.user=$JDBC_DATABASE_USER -Ddb.default.password=$JDBC_DATABASE_PASSWORD -jar standalone-build/target/scala-2.11/*.jar

You can customize this by setting JAVA_OPTS like this:

$ heroku config:set JAVA_OPTS="-XX:+UseCompressedOops"

Or you can create a Procfile in the root directory with contents like this:

web: java \$JAVA_OPTS -Dskinny.port=\$PORT -Dskinny.env=production -Ddb.default.url=\$JDBC_DATABASE_URL -Ddb.default.user=\$JDBC_DATABASE_USER -Ddb.default.password=\$JDBC_DATABASE_PASSWORD -jar standalone-build/target/scala-2.11/*.jar

Then add the Procfile to Git and redeploy with git push heroku master.

License

MIT

heroku-buildpack-skinny's People

Contributors

jkutner avatar ytaras avatar

Watchers

 avatar  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.