Skip to content

miracle2k/buildstep

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

miracle2k/buildstep

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

Based on tutumcloud/buildstep and progrium/buildstep, both of them dormant projects.

Usage

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

FROM elsdoerfer/buildstep
EXPOSE 8000
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]

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 8000 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 0.0.0.0:8000

you can use it by defining the following Dockerfile instead:

FROM miracle2k/buildstep
EXPOSE 8000
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 8000 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 8000 -e PORT=8000 -e GIT_REPO=https://github.com/fermayo/hello-world-django.git tutum/buildstep python manage.py runserver 0.0.0.0:8000

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

No docker build required!

About

Buildstep uses Docker and Buildpacks to build applications like Heroku

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Groovy 39.2%
  • Java 15.5%
  • Gherkin 11.5%
  • Ruby 10.8%
  • Scala 8.1%
  • Clojure 4.7%
  • Other 10.2%