Code Monkey home page Code Monkey logo

cloudfoundry-buildpack-haskell-stack's Introduction

Cloud Foundry buildpack for Stack based Haskell projects. Based on the excellent heroku-buildpack-stack.

Usage

Push an app with version 1.0 of this buildpack:

$ cf push haskell-api -b  https://github.com/mikegehard/cloudfoundry-buildpack-haskell-stack#1.0 -m 2GB

Proxy

One Proxy

If you're behind a proxy, simply set https_proxy environment variable to the desired value (e.g. in the manifest) and the buildpack will pick it up.

Two Proxies

If your PCF instance is behind a proxy and you find yourself in a situation where:

  • it takes one proxy setting to let your buildpack download Stack from the Internet (proxy.example.com:80)
  • but it also takes another proxy setting to let Stack download its dependencies (http://user:[email protected])
  • and those two proxy settings are different

this buildpack lets you configure your second proxy by setting the

stack_proxy

environment variable (e.g. in the manifest) to the desired value. The way the buildpack is going to work is:

  • it will use the https_proxy as it would in the one proxy scenario
  • as it detects the moment where Stack starts pulling its dependencies, it will temporarily swap the current proxy setting with with the stack_proxy setting.

Sample Manifest

---
applications:
- name: your-application-name
  buildpacks:
  - https://github.com/mikegehard/cloudfoundry-buildpack-haskell-stack
  instances: 1
  memory: 2G
  disk_quota: 2G
  health-check-type: process
  timeout: 180
  env:
    https_proxy: "proxy.example.com:80"
    stack_proxy: "http://user:[email protected]"

Note: The first push of an application requires a lot of memory to prime the Stack cache with all of the libraries. It is recommended that you set the app memory to 2GB for the first push and scale it back down after the push completes. You may also need to scale up before subsequent pushes and scale down after those pushes complete. It seems that the v3 Cloud Controller API will allow for setting the compilation container memory differently than the runtime container memory so this may go away in the future.

App constraints

The application must pull the port to use from the PORT environment variable.

An example Scotty app:

main :: IO ()
main = do
    putStrLn "Starting server..."
    port <- lookupEnv "PORT"
    scotty (maybe 3000 read port) $ do
        WebApp.routes

See here for source code of an example app deployed to PWS.

cloudfoundry-buildpack-haskell-stack's People

Contributors

eriknstevenson avatar ismailmustafa avatar mfine avatar mikegehard avatar nrolland avatar piotrjustyna 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.