Giter Site home page Giter Site logo

cf-varnish-buildpack's Introduction

Deploy varnish to Cloud Foundry

Need Varnish on Cloud Foundry? It is now easy to have that.

You need to create your Varnish configuration file(s) in the directory etc/ and call the "master" file default.vcl. Then do

cf push my-varnish -m 128M -b https://github.com/chregu/cf-varnish-buildpack.git

and it should soon be available on Cloud Foundry.

You need Varnish and PHP in one buildpack?

Head over to my fork of the PHP buildpack which adds varnish to that: https://github.com/chregu/cf-php-varnish-buildpack

Configuration

Changing the memory size used by varnish

By default, this varnish uses -s malloc,$MEMORY_LIMIT, where $MEMORY_LIMIT is the memory limit applied to this app. you can overwrite that in the manifest.yml with

  env:
    VARNISH_MEMORY_LIMIT: 256m

The default values used for starting varnishd can be seen in boot.sh. If you want to change those, you can copy boot.sh to your app root dir and set new values. (Maybe we'll make those adjustable via env variable later as well)

Administrator Upload

Everyone can automatically use this buildpack if your Cloud Foundry Administrator uploads it.

To create/upload from source repository

zip -r ../varnish-buildpack.zip *
cf create-buildpack varnish_buildpack ../varnish-buildpack.zip 10

Subsequently, update the buildpack with:

zip -r ../varnish-buildpack.zip *
cf update-buildpack varnish_buildpack -p ../varnish-buildpack.zip

Test that it correctly detects the buildpack:

cf push varnishtest -p test/fixtures/varnish
...
Staging failed: An application could not be detected by any available buildpack

Building Varnish

We use docker for building varnish.

./bin/build_varnish

Varnish will be stuffed into a tarball in the vendor/ folder.

Acknowledgements

This buildpack is based heavily upon Cloud Foundry's staticfile-buildpack (which is heavily based on Jordon Bedwell's Heroku buildpack and the modifications by David Laing for Cloud Foundry nginx-buildpack). Thanks for the buildpack, Cloud Foundry!!

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.