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

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

Stargazers

 avatar  avatar  avatar  avatar  avatar

cloudfoundry-buildpack-haskell-stack's Issues

Problems loading lts-6.6 build plan

First of all, great work and much appreciated ๐Ÿฅ‡

Having some problems pushing the sample app, any idea what could be causing this? cf push output:

Waiting for API to complete processing files...

Staging app and tracing logs...
   Cell 4915dda9-96ce-4ea0-96cb-d46110b31df4 creating container for instance 0328951e-4fa5-427a-8b05-5a299665a9cc
   Cell 4915dda9-96ce-4ea0-96cb-d46110b31df4 successfully created container for instance 0328951e-4fa5-427a-8b05-5a299665a9cc
   Downloading app package...
   Downloaded app package (6.7K)
   -----> 2019-01-09_15:49:53 Starting...
   -----> 2019-01-09_15:49:53 Downloading stack-1.2.0
   ######################################################################## 100.0%
   ######################################################################## 100.0%
                                                                              0.5%
   ##                                                                         2.9%
   ####                                                                       6.5%
   #######                                                                   10.0%
   #########                                                                 13.6%
   ############                                                              17.2%
   ##############                                                            20.7%
   #################                                                         24.3%
   ####################                                                      27.8%
   ######################                                                    31.2%
   #########################                                                 34.8%
   ###########################                                               38.4%
   ##############################                                            41.9%
   ################################                                          45.5%
   ###################################                                       49.0%
   #####################################                                     52.4%
   ########################################                                  56.0%
   ##########################################                                59.6%
   #############################################                             63.1%
   ################################################                          66.7%
   ##################################################                        70.2%
   #####################################################                     73.8%
   #######################################################                   77.4%
   ##########################################################                80.9%
   ############################################################              84.5%
   ###############################################################           88.1%
   #################################################################         91.6%
   ####################################################################      95.2%
   #######################################################################   98.7%
   ######################################################################## 100.0%
   -----> 2019-01-09_15:49:57 Running stack
   Downloading lts-6.6 build plan ...
   HttpExceptionRequest Request {
     host                 = "raw.githubusercontent.com"
     port                 = 443
     secure               = True
     requestHeaders       = []
     path                 = "/fpco/lts-haskell/master//lts-6.6.yaml"
     queryString          = ""
     method               = "GET"
     proxy                = Nothing
     rawBody              = False
     redirectCount        = 10
     responseTimeout      = ResponseTimeoutDefault
     requestVersion       = HTTP/1.1
   }
    (ProxyConnectException "raw.githubusercontent.com" 443 (Status {statusCode = 407, statusMessage = "authenticationrequired"}))
   Failed to compile droplet: Failed to compile droplet: exit status 1
   Exit status 223
   Cell 4915dda9-96ce-4ea0-96cb-d46110b31df4 stopping instance 0328951e-4fa5-427a-8b05-5a299665a9cc
   Cell 4915dda9-96ce-4ea0-96cb-d46110b31df4 destroying container for instance 0328951e-4fa5-427a-8b05-5a299665a9cc
Error staging application: App staging failed in the buildpack compile phase
FAILED

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.