Coder Social home page Coder Social logo

buildstep's Introduction

tutum/buildstep

Base docker image to create containers from app code using Heroku's buildpacks.

Supported languages

Check https://github.com/progrium/buildstep#supported-buildpacks for a list of buildpacks supported.

Usage

Create a Dockerfile similar to the following in your application code folder (this example is for a typical Django app):

FROM tutum/buildstep
EXPOSE 80
CMD ["python", "manage.py", "runserver", "80"]

Modify the EXPOSE and CMD directives with the port to be exposed and the command used to launch your application respectively.

Then, execute the following to build the image:

docker build -t myuser/myapp .

This will create an image named myuser/myapp with your application ready to go. To launch it, just type:

docker run -d -p 80 myuser/myapp

Easy!

Usage with Procfile

If you have already defined a Procfile (https://devcenter.heroku.com/articles/procfile) like the following:

web: python manage.py runserver 80

you can use it by defining the following Dockerfile instead:

FROM tutum/buildstep
EXPOSE 80
CMD ["/start", "web"]

Modify the EXPOSE and CMD directives with the port to be exposed and the process type defined in the Procfile used to launch your application respectively.

It also works if you don't have a Procfile

Then, execute the following to build the image:

docker build -t myuser/myapp .
docker run -d -p 80 myuser/myapp

Done!

On-the-fly usage

You can also make it run your application on the fly (without having to create or build a Dockerfile) by passing an environment variable GIT_REPO with your application's git repository URL.

If your repository has a Procfile (or the buildpack you are using has a default Procfile), you can specify the process type name as the run command. Otherwise, you can specify the actual command used to launch your application as the run command. For example:

# Without a Procfile
docker run -d -p 80 -e GIT_REPO=https://github.com/fermayo/hello-world-django.git tutum/buildstep python manage.py runserver 80

# With a Procfile (or relying on the default Procfile provided by the buildpack)
docker run -d -p 80 -e GIT_REPO=https://github.com/fermayo/hello-world-php.git tutum/buildstep /start web

No docker build required!

buildstep's People

Contributors

alanjds avatar amaltson avatar amscotti avatar asm89 avatar bltavares avatar carlhoerberg avatar chh avatar dmitriy-kiriyenko avatar edofic avatar elia avatar ericreid avatar fcoury avatar grigio avatar icco avatar j15e avatar jbrooksuk avatar kloadut avatar leemhenson avatar lukec avatar mike-park avatar nolman avatar plietar avatar progrium avatar qrohlf avatar rnorth avatar

Watchers

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