Skip to content

Commit 16e5c3b

Browse files
committed
Merge pull request #612 from opdemand/604-dockerfile-docs
add dockerfile/buildpack docs
2 parents c1357cc + 44a040f commit 16e5c3b

4 files changed

Lines changed: 194 additions & 45 deletions

File tree

docs/developer/buildpack.rst

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
:title: Deploying with Heroku Buildpacks on Deis
2+
:description: A howto on deploying applications using Heroku Buildpacks
3+
:keywords: tutorial, guide, walkthrough, howto, deis, developer, dev, buildpack, heroku
4+
5+
Buildpacks
6+
==========
7+
8+
Buildpacks are bundles of detection and configuration scripts which set up containers to
9+
run applications.
10+
11+
Deploy using Buildpacks
12+
-----------------------
13+
14+
For convenience, there are a few buildpacks that are bundled with Deis:
15+
16+
* `Java buildpack`_
17+
* `Ruby Buildpack`_
18+
* `Python Buildpack`_
19+
* `Nodejs Buildpack`_
20+
* `Play Buildpack`_
21+
* `PHP Buildpack`_
22+
* `Clojure Buildpack`_
23+
* `Golang Buildpack`_
24+
* `Scala Buildpack`_
25+
* `Dart Buildpack`_
26+
* `Perl Buildpack`_
27+
28+
Deis will cycle through the ``bin/detect`` scripts of each buildpack to match the code you
29+
are pushing.
30+
31+
Adding Custom Buildpacks
32+
------------------------
33+
34+
To add a specific buildpack to your custom Deis cluster, you will need to make the change
35+
in the `builder recipe`_ for the `Deis cookbook`_.
36+
37+
.. note::
38+
39+
Not all Heroku buildpacks work with Deis due to environmental differences (e.g.
40+
missing libraries, Heroku-specific environment changes). Test any buildpack before
41+
using it in production deployments.
42+
43+
Deploying an App with a Custom Buildpack
44+
----------------------------------------
45+
46+
If you want your application to use a specific buildpack that is not included in the list,
47+
you can set the BUILDPACK_URL environment variable for your application before your first
48+
push. For example:
49+
50+
.. code-block:: console
51+
52+
$ deis config:set BUILDPACK_URL=https://github.com/bacongobbler/heroku-buildpack-jekyll
53+
=== classy-hardtack
54+
BUILDPACK_URL: https://github.com/bacongobbler/heroku-buildpack-jekyll
55+
56+
.. note::
57+
58+
Setting config variables before your first deployment results in an error. See `issue
59+
542`_ for more details.
60+
61+
.. _`Java buildpack`: https://github.com/heroku/heroku-buildpack-java.git
62+
.. _`Ruby buildpack`: https://github.com/heroku/heroku-buildpack-ruby.git
63+
.. _`Python buildpack`: https://github.com/heroku/heroku-buildpack-python.git
64+
.. _`Nodejs buildpack`: https://github.com/gabrtv/heroku-buildpack-nodejs
65+
.. _`Play buildpack`: https://github.com/heroku/heroku-buildpack-play.git
66+
.. _`PHP buildpack`: https://github.com/CHH/heroku-buildpack-php.git
67+
.. _`Clojure buildpack`: https://github.com/heroku/heroku-buildpack-clojure.git
68+
.. _`Golang buildpack`: https://github.com/kr/heroku-buildpack-go.git
69+
.. _`Scala buildpack`: https://github.com/heroku/heroku-buildpack-scala.git
70+
.. _`Dart buildpack`: https://github.com/igrigorik/heroku-buildpack-dart.git
71+
.. _`Perl buildpack`: https://github.com/miyagawa/heroku-buildpack-perl/tree/carton
72+
.. _`builder recipe`: https://github.com/opdemand/deis-cookbook/blob/master/recipes/builder.rb
73+
.. _`Deis cookbook`: https://github.com/opdemand/deis-cookbook.git
74+
.. _`issue 542`: https://github.com/opdemand/deis/issues/542

docs/developer/deploy-application.rst

Lines changed: 87 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,29 @@
44

55
Deploy an Application
66
=====================
7-
Deis allows you to deploy and scale your :ref:`Application` in seconds
8-
using Docker's industry-standard `Linux container engine`_.
7+
8+
An :ref:`Application` is typically deployed to Deis by pushing source code using the deis
9+
client or other clients that communicate with Deis' API endpoints. Deploying
10+
applications will be different depending on the source code and its requirements.
11+
12+
Authenticating with the API
13+
---------------------------
14+
15+
Before deploying an application, all users must first authenticate against the Deis
16+
:ref:`Controller`. For example:
17+
18+
.. code-block:: console
19+
20+
$ deis login http://example.com
21+
username: deis
22+
password:
23+
Logged in as deis
924
1025
Create an Application
1126
---------------------
12-
Change directory into a git repository for the app you'd like to deploy,
13-
then use the ``deis create`` command to create a new Deis application.
27+
28+
Change to the root directory of your project you'd like to deploy, then use the ``deis
29+
create`` command to create a remote repository for you to push your application to.
1430

1531
.. code-block:: console
1632
@@ -21,45 +37,57 @@ then use the ``deis create`` command to create a new Deis application.
2137
2238
Deploy the Application
2339
----------------------
40+
2441
With the application created and associated with the SSH :ref:`Key` on your account,
25-
deploy it with ``git push deis master``.
42+
deploy it with ``git push deis master``. If you don't have an application to test with,
43+
you can use `our Dockerfile example`_.
2644

2745
.. code-block:: console
2846
29-
$ git push deis master
30-
Counting objects: 17, done.
47+
><> deis create --formation=dev
48+
Creating application... done, created owlish-huntress
49+
Git remote deis added
50+
><> git push deis master
51+
Counting objects: 10, done.
3152
Delta compression using up to 8 threads.
32-
Compressing objects: 100% (10/10), done.
33-
Writing objects: 100% (17/17), 2.35 KiB, done.
34-
Total 17 (delta 2), reused 0 (delta 0)
35-
Java app detected
36-
-----> Installing OpenJDK 1.6... done
37-
-----> Installing Maven 3.0.3... done
38-
-----> Installing settings.xml... done
39-
-----> executing /cache/.maven/bin/mvn -B -Duser.home=/build/app -Dmaven.repo.local=/cache/.m2/repository -s /cache/.m2/settings.xml -DskipTests=true clean install
40-
[INFO] Scanning for projects...
41-
...
42-
[INFO] -------------------------------------------
43-
[INFO] BUILD SUCCESS
44-
[INFO] -------------------------------------------
45-
[INFO] Total time: 11.771s
46-
[INFO] Finished at: Tue Dec 03 00:00:03 UTC 2013
47-
[INFO] Final Memory: 12M/142M
48-
[INFO] -------------------------------------------
49-
-----> Discovering process types
50-
Procfile declares types -> web
53+
Compressing objects: 100% (9/9), done.
54+
Writing objects: 100% (10/10), 1.70 KiB | 0 bytes/s, done.
55+
Total 10 (delta 0), reused 0 (delta 0)
56+
-----> Building Docker image
57+
Uploading context 5.632 kB
58+
Uploading context
59+
Step 0 : FROM ubuntu:12.04
60+
---> 9cd978db300e
61+
Step 1 : MAINTAINER OpDemand <info@opdemand.com>
62+
---> Running in 9aefab8ad92c
63+
---> da93d76703b7
64+
Step 2 : ENV PORT 8000
65+
---> Running in 8ce25ddf4405
66+
---> b6046ec54bb3
67+
Step 3 : ADD . /app
68+
---> 5567f79d87fe
69+
Step 4 : WORKDIR /app
70+
---> Running in 0b2c7906381c
71+
---> 444006758e39
72+
Step 5 : CMD python -m SimpleHTTPServer $PORT
73+
---> Running in b33074f3c0ea
74+
---> 5a55b32b8da2
75+
Successfully built 5a55b32b8da2
76+
-----> Pushing image to private registry
5177
52-
-----> Compiled slug size: 63.5 MB
5378
Launching... done, v2
54-
55-
-----> peachy-waxworks deployed to Deis
56-
http://peachy-waxworks.example.com ...
57-
58-
$ curl -s http://peachy-waxworks.example.com
59-
Powered by Deis!
79+
80+
-----> owlish-huntress deployed to Deis
81+
http://owlish-huntress.example.com
82+
83+
To learn more, use `deis help` or visit http://deis.io
84+
85+
><> curl -s http://owlish-huntress.example.com
86+
<h1>Powered by Deis</h1>
6087
6188
Supported Applications
6289
----------------------
90+
6391
As a Heroku-inspired Platform-as-a-Service, Deis is designed to deploy and scale
6492
apps that adhere to `twelve-factor methodology`_.
6593

@@ -71,22 +99,36 @@ Fortunately, most modern applications feature a stateless application tier that
7199
can scale horizontally behind a load balancer. These applications are a perfect
72100
fit for Deis. Deis currently suppports the following languages:
73101

74-
* Java
75-
* Python
76-
* Ruby
77-
* Node.js
78-
* Clojure
79-
* Scala
80-
* Play Framework
81-
* PHP
82-
* Perl
83-
* Dart
84-
* Go
102+
* `Clojure`_
103+
* `Dart`_
104+
* `Dockerfile`_
105+
* `Golang`_
106+
* `Java`_
107+
* `Nodejs`_
108+
* `Perl`_
109+
* `PHP`_
110+
* `Play`_
111+
* `Python`_
112+
* `Ruby`_
113+
* `Scala`_
85114

86115
Support for many other languages and frameworks is possible through
87116
use of custom `Heroku Buildpacks`_ and `Dockerfiles`_.
88117

118+
.. _`Clojure`: https://github.com/opdemand/example-clojure-ring
119+
.. _`Dart`: https://github.com/opdemand/example-dart
120+
.. _`Dockerfile`: https://github.com/opdemand/example-dockerfile-python
121+
.. _`Golang`: https://github.com/opdemand/example-go
122+
.. _`Java`: https://github.com/opdemand/example-java-jetty
123+
.. _`Nodejs`: https://github.com/opdemand/example-nodejs-express
124+
.. _`Perl`: https://github.com/opdemand/example-perl
125+
.. _`PHP`: https://github.com/opdemand/example-php
126+
.. _`Play`: https://github.com/opdemand/example-play
127+
.. _`Python`: https://github.com/opdemand/example-python-flask
128+
.. _`Ruby`: https://github.com/opdemand/example-ruby-sinatra
129+
.. _`Scala`: https://github.com/opdemand/example-scala
89130
.. _`Linux container engine`: http://docker.io/
90131
.. _`twelve-factor methodology`: http://12factor.net/
91132
.. _`Heroku Buildpacks`: https://devcenter.heroku.com/articles/buildpacks
92-
.. _`Dockerfiles`: http://docs.docker.io/en/latest/use/builder/
133+
.. _`Dockerfiles`: http://docs.docker.io/en/latest/use/builder/
134+
.. _`our Dockerfile example`: https://github.com/opdemand/example-dockerfile-python

docs/developer/dockerfile.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
:title: Deploying with Dockerfiles on Deis
2+
:description: A howto on deploying applications using Dockerfiles
3+
:keywords: tutorial, guide, walkthrough, howto, deis, developer, dev, docker, dockerfile
4+
5+
Dockerfiles
6+
===========
7+
8+
A Dockerfile automates the steps you would otherwise take manually to create an image.
9+
Deis supports Dockerfiles right out of the box, so you can run your application in your
10+
own custom Docker image.
11+
12+
Deploy using Dockerfiles
13+
------------------------
14+
15+
With Dockerfiles, the stack you deploy your application upon is limitless. The only
16+
requirement is that it sets a ENV entry to set the PORT environment variable. This is so
17+
`slugrunner`_ can listen for when the process is alive or dead. For example:
18+
19+
.. code-block:: console
20+
21+
FROM centos:latest
22+
MAINTAINER OpDemand <info@opdemand.com>
23+
ENV PORT 8000
24+
ADD . /app
25+
WORKDIR /app
26+
CMD python -m SimpleHTTPServer $PORT
27+
28+
Which will serve your application's root directory on a static file server on Docker's
29+
official CentOS image.
30+
31+
.. _`slugrunner`: https://github.com/deis/slugrunner

docs/developer/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ Developer Guide
1616
install-client
1717
register-user
1818
deploy-application
19+
buildpack
20+
dockerfile
1921
manage-application

0 commit comments

Comments
 (0)