This commit is contained in:
Aanand Prasad 2014-08-08 15:22:13 -07:00
commit 3d115aa945
8 changed files with 18 additions and 19 deletions

View file

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href='http://fonts.googleapis.com/css?family=Lilita+One|Lato:300,400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/fig.css?20140807310306634594032">
<link rel="stylesheet" type="text/css" href="css/fig.css?20140808310756672680036">
<link rel="canonical" href="http://www.fig.sh/">
</head>
<body>
@ -82,7 +82,7 @@ $ cd figtest
redis
</code></pre></div>
<p>Next, we want to create a Docker image containing all of our app&#39;s dependencies. We specify how to build one using a file called <code>Dockerfile</code>:</p>
<div class="highlight"><pre><code class="text language-text" data-lang="text">FROM orchardup/python:2.7
<div class="highlight"><pre><code class="text language-text" data-lang="text">FROM python:2.7
ADD . /code
WORKDIR /code
RUN pip install -r requirements.txt
@ -100,18 +100,18 @@ RUN pip install -r requirements.txt
links:
- redis
redis:
image: orchardup/redis
image: redis
</code></pre></div>
<p>This defines two services:</p>
<ul>
<li><code>web</code>, which is built from <code>Dockerfile</code> in the current directory. It also says to run the command <code>python app.py</code> inside the image, forward the exposed port 5000 on the container to port 5000 on the host machine, connect up the Redis service, and mount the current directory inside the container so we can work on code without having to rebuild the image.</li>
<li><code>redis</code>, which uses the public image <a href="https://index.docker.io/u/orchardup/redis/">orchardup/redis</a>. </li>
<li><code>redis</code>, which uses the public image <a href="https://registry.hub.docker.com/_/redis/">redis</a>. </li>
</ul>
<p>Now if we run <code>fig up</code>, it&#39;ll pull a Redis image, build an image for our own code, and start everything up:</p>
<div class="highlight"><pre><code class="text language-text" data-lang="text">$ fig up
Pulling image orchardup/redis...
Pulling image redis...
Building web...
Starting figtest_redis_1...
Starting figtest_web_1...