update
This commit is contained in:
parent
ae15e9b895
commit
76e42d418a
8 changed files with 36 additions and 45 deletions
7
cli.html
7
cli.html
|
|
@ -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?20140806312262093609022">
|
||||
<link rel="stylesheet" type="text/css" href="css/fig.css?20140807310288269723058">
|
||||
<link rel="canonical" href="http://www.fig.sh/cli.html">
|
||||
</head>
|
||||
<body>
|
||||
|
|
@ -119,11 +119,10 @@ For example:</p>
|
|||
</ul>
|
||||
<ul class="nav">
|
||||
<li><a href="https://github.com/orchardup/fig">Fig on GitHub</a></li>
|
||||
<li><a href="http://webchat.freenode.net/?channels=%23orchardup&uio=d4">#orchardup on Freenode</a></li>
|
||||
<li><a href="http://webchat.freenode.net/?channels=%23docker&uio=d4">#docker on Freenode</a></li>
|
||||
</ul>
|
||||
|
||||
<p>Fig is a project from <a href="https://www.orchardup.com">Orchard</a>, a Docker hosting service.</p>
|
||||
<p><a href="https://twitter.com/orchardup">Follow us on Twitter</a> to keep up to date with Fig and other Docker news.</p>
|
||||
<p>Fig is a project from <a href="https://www.docker.com">Docker</a>.</p>
|
||||
|
||||
<div class="badges">
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=orchardup&repo=fig&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="100" height="20"></iframe>
|
||||
|
|
|
|||
24
django.html
24
django.html
|
|
@ -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?20140806312262093609022">
|
||||
<link rel="stylesheet" type="text/css" href="css/fig.css?20140807310288269723058">
|
||||
<link rel="canonical" href="http://www.fig.sh/django.html">
|
||||
</head>
|
||||
<body>
|
||||
|
|
@ -23,9 +23,8 @@
|
|||
<p>Let's use Fig to set up and run a Django/PostgreSQL app. Before starting, you'll need to have <a href="install.html">Fig installed</a>.</p>
|
||||
|
||||
<p>Let's set up the three files that'll get us started. First, our app is going to be running inside a Docker container which contains all of its dependencies. We can define what goes inside that Docker container using a file called <code>Dockerfile</code>. It'll contain this to start with:</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
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
RUN apt-get update -qq && apt-get install -y python-psycopg2
|
||||
RUN mkdir /code
|
||||
WORKDIR /code
|
||||
ADD requirements.txt /code/
|
||||
|
|
@ -36,10 +35,11 @@ ADD . /code/
|
|||
|
||||
<p>Second, we define our Python dependencies in a file called <code>requirements.txt</code>:</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text">Django
|
||||
psycopg2
|
||||
</code></pre></div>
|
||||
<p>Simple enough. Finally, this is all tied together with a file called <code>fig.yml</code>. It describes the services that our app comprises of (a web server and database), what Docker images they use, how they link together, what volumes will be mounted inside the containers and what ports they expose.</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text">db:
|
||||
image: orchardup/postgresql
|
||||
image: postgres
|
||||
web:
|
||||
build: .
|
||||
command: python manage.py runserver 0.0.0.0:8000
|
||||
|
|
@ -65,15 +65,14 @@ Dockerfile fig.yml figexample manage.py requirements
|
|||
<div class="highlight"><pre><code class="text language-text" data-lang="text">DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
'NAME': 'docker',
|
||||
'USER': 'docker',
|
||||
'PASSWORD': 'docker',
|
||||
'HOST': os.environ.get('DB_1_PORT_5432_TCP_ADDR'),
|
||||
'PORT': os.environ.get('DB_1_PORT_5432_TCP_PORT'),
|
||||
'NAME': 'postgres',
|
||||
'USER': 'postgres',
|
||||
'HOST': 'db_1',
|
||||
'PORT': 5432,
|
||||
}
|
||||
}
|
||||
</code></pre></div>
|
||||
<p>These settings are determined by the <a href="https://github.com/orchardup/docker-postgresql">orchardup/postgresql</a> Docker image we are using.</p>
|
||||
<p>These settings are determined by the <a href="https://registry.hub.docker.com/_/postgres/">postgres</a> Docker image we are using.</p>
|
||||
|
||||
<p>Then, run <code>fig up</code>:</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text">Recreating myapp_db_1...
|
||||
|
|
@ -122,11 +121,10 @@ myapp_web_1 | Quit the server with CONTROL-C.
|
|||
</ul>
|
||||
<ul class="nav">
|
||||
<li><a href="https://github.com/orchardup/fig">Fig on GitHub</a></li>
|
||||
<li><a href="http://webchat.freenode.net/?channels=%23orchardup&uio=d4">#orchardup on Freenode</a></li>
|
||||
<li><a href="http://webchat.freenode.net/?channels=%23docker&uio=d4">#docker on Freenode</a></li>
|
||||
</ul>
|
||||
|
||||
<p>Fig is a project from <a href="https://www.orchardup.com">Orchard</a>, a Docker hosting service.</p>
|
||||
<p><a href="https://twitter.com/orchardup">Follow us on Twitter</a> to keep up to date with Fig and other Docker news.</p>
|
||||
<p>Fig is a project from <a href="https://www.docker.com">Docker</a>.</p>
|
||||
|
||||
<div class="badges">
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=orchardup&repo=fig&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="100" height="20"></iframe>
|
||||
|
|
|
|||
7
env.html
7
env.html
|
|
@ -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?20140806312262093609022">
|
||||
<link rel="stylesheet" type="text/css" href="css/fig.css?20140807310288269723058">
|
||||
<link rel="canonical" href="http://www.fig.sh/env.html">
|
||||
</head>
|
||||
<body>
|
||||
|
|
@ -68,11 +68,10 @@ Fully qualified container name, e.g. <code>DB_1_NAME=/myapp_web_1/myapp_db_1</co
|
|||
</ul>
|
||||
<ul class="nav">
|
||||
<li><a href="https://github.com/orchardup/fig">Fig on GitHub</a></li>
|
||||
<li><a href="http://webchat.freenode.net/?channels=%23orchardup&uio=d4">#orchardup on Freenode</a></li>
|
||||
<li><a href="http://webchat.freenode.net/?channels=%23docker&uio=d4">#docker on Freenode</a></li>
|
||||
</ul>
|
||||
|
||||
<p>Fig is a project from <a href="https://www.orchardup.com">Orchard</a>, a Docker hosting service.</p>
|
||||
<p><a href="https://twitter.com/orchardup">Follow us on Twitter</a> to keep up to date with Fig and other Docker news.</p>
|
||||
<p>Fig is a project from <a href="https://www.docker.com">Docker</a>.</p>
|
||||
|
||||
<div class="badges">
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=orchardup&repo=fig&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="100" height="20"></iframe>
|
||||
|
|
|
|||
13
index.html
13
index.html
|
|
@ -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?20140806312262093609022">
|
||||
<link rel="stylesheet" type="text/css" href="css/fig.css?20140807310288269723058">
|
||||
<link rel="canonical" href="http://www.fig.sh/">
|
||||
</head>
|
||||
<body>
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
<div class="content"><p><strong class="strapline">Fast, isolated development environments using Docker.</strong></p>
|
||||
|
||||
<p>Define your app's environment with Docker so it can be reproduced anywhere:</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
|
||||
|
|
@ -35,7 +35,7 @@ RUN pip install -r requirements.txt
|
|||
<span class="l-Scalar-Plain">ports</span><span class="p-Indicator">:</span>
|
||||
<span class="p-Indicator">-</span> <span class="s">"8000:8000"</span>
|
||||
<span class="l-Scalar-Plain">db</span><span class="p-Indicator">:</span>
|
||||
<span class="l-Scalar-Plain">image</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">orchardup/postgresql</span>
|
||||
<span class="l-Scalar-Plain">image</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">postgres</span>
|
||||
</code></pre></div>
|
||||
<p>(No more installing Postgres on your laptop!)</p>
|
||||
|
||||
|
|
@ -138,7 +138,7 @@ figtest_web_1 /bin/sh -c python app.py Up 5000->5000/tcp
|
|||
<p>If you started Fig with <code>fig up -d</code>, you'll probably want to stop your services once you've finished with them:</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text">$ fig stop
|
||||
</code></pre></div>
|
||||
<p>That's more-or-less how Fig works. See the reference section below for full details on the commands, configuration file and environment variables. If you have any thoughts or suggestions, <a href="https://github.com/orchardup/fig">open an issue on GitHub</a> or <a href="mailto:hello@orchardup.com">email us</a>.</p>
|
||||
<p>That's more-or-less how Fig works. See the reference section below for full details on the commands, configuration file and environment variables. If you have any thoughts or suggestions, <a href="https://github.com/orchardup/fig">open an issue on GitHub</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="sidebar">
|
||||
|
|
@ -166,11 +166,10 @@ figtest_web_1 /bin/sh -c python app.py Up 5000->5000/tcp
|
|||
</ul>
|
||||
<ul class="nav">
|
||||
<li><a href="https://github.com/orchardup/fig">Fig on GitHub</a></li>
|
||||
<li><a href="http://webchat.freenode.net/?channels=%23orchardup&uio=d4">#orchardup on Freenode</a></li>
|
||||
<li><a href="http://webchat.freenode.net/?channels=%23docker&uio=d4">#docker on Freenode</a></li>
|
||||
</ul>
|
||||
|
||||
<p>Fig is a project from <a href="https://www.orchardup.com">Orchard</a>, a Docker hosting service.</p>
|
||||
<p><a href="https://twitter.com/orchardup">Follow us on Twitter</a> to keep up to date with Fig and other Docker news.</p>
|
||||
<p>Fig is a project from <a href="https://www.docker.com">Docker</a>.</p>
|
||||
|
||||
<div class="badges">
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=orchardup&repo=fig&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="100" height="20"></iframe>
|
||||
|
|
|
|||
|
|
@ -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?20140806312262093609022">
|
||||
<link rel="stylesheet" type="text/css" href="css/fig.css?20140807310288269723058">
|
||||
<link rel="canonical" href="http://www.fig.sh/install.html">
|
||||
</head>
|
||||
<body>
|
||||
|
|
@ -66,11 +66,10 @@ $ chmod +x /usr/local/bin/fig
|
|||
</ul>
|
||||
<ul class="nav">
|
||||
<li><a href="https://github.com/orchardup/fig">Fig on GitHub</a></li>
|
||||
<li><a href="http://webchat.freenode.net/?channels=%23orchardup&uio=d4">#orchardup on Freenode</a></li>
|
||||
<li><a href="http://webchat.freenode.net/?channels=%23docker&uio=d4">#docker on Freenode</a></li>
|
||||
</ul>
|
||||
|
||||
<p>Fig is a project from <a href="https://www.orchardup.com">Orchard</a>, a Docker hosting service.</p>
|
||||
<p><a href="https://twitter.com/orchardup">Follow us on Twitter</a> to keep up to date with Fig and other Docker news.</p>
|
||||
<p>Fig is a project from <a href="https://www.docker.com">Docker</a>.</p>
|
||||
|
||||
<div class="badges">
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=orchardup&repo=fig&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="100" height="20"></iframe>
|
||||
|
|
|
|||
|
|
@ -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?20140806312262093609022">
|
||||
<link rel="stylesheet" type="text/css" href="css/fig.css?20140807310288269723058">
|
||||
<link rel="canonical" href="http://www.fig.sh/rails.html">
|
||||
</head>
|
||||
<body>
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
<p>We're going to use Fig to set up and run a Rails/PostgreSQL app. Before starting, you'll need to have <a href="install.html">Fig installed</a>.</p>
|
||||
|
||||
<p>Let's set up the three files that'll get us started. First, our app is going to be running inside a Docker container which contains all of its dependencies. We can define what goes inside that Docker container using a file called <code>Dockerfile</code>. It'll contain this to start with:</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text">FROM binaryphile/ruby:2.0.0-p247
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text">FROM ruby
|
||||
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev
|
||||
RUN mkdir /myapp
|
||||
WORKDIR /myapp
|
||||
|
|
@ -127,11 +127,10 @@ myapp_web_1 | [2014-01-17 17:16:29] INFO WEBrick::HTTPServer#start: pid=1 port=
|
|||
</ul>
|
||||
<ul class="nav">
|
||||
<li><a href="https://github.com/orchardup/fig">Fig on GitHub</a></li>
|
||||
<li><a href="http://webchat.freenode.net/?channels=%23orchardup&uio=d4">#orchardup on Freenode</a></li>
|
||||
<li><a href="http://webchat.freenode.net/?channels=%23docker&uio=d4">#docker on Freenode</a></li>
|
||||
</ul>
|
||||
|
||||
<p>Fig is a project from <a href="https://www.orchardup.com">Orchard</a>, a Docker hosting service.</p>
|
||||
<p><a href="https://twitter.com/orchardup">Follow us on Twitter</a> to keep up to date with Fig and other Docker news.</p>
|
||||
<p>Fig is a project from <a href="https://www.docker.com">Docker</a>.</p>
|
||||
|
||||
<div class="badges">
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=orchardup&repo=fig&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="100" height="20"></iframe>
|
||||
|
|
|
|||
|
|
@ -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?20140806312262093609022">
|
||||
<link rel="stylesheet" type="text/css" href="css/fig.css?20140807310288269723058">
|
||||
<link rel="canonical" href="http://www.fig.sh/wordpress.html">
|
||||
</head>
|
||||
<body>
|
||||
|
|
@ -117,11 +117,10 @@ if(file_exists($root.$path))
|
|||
</ul>
|
||||
<ul class="nav">
|
||||
<li><a href="https://github.com/orchardup/fig">Fig on GitHub</a></li>
|
||||
<li><a href="http://webchat.freenode.net/?channels=%23orchardup&uio=d4">#orchardup on Freenode</a></li>
|
||||
<li><a href="http://webchat.freenode.net/?channels=%23docker&uio=d4">#docker on Freenode</a></li>
|
||||
</ul>
|
||||
|
||||
<p>Fig is a project from <a href="https://www.orchardup.com">Orchard</a>, a Docker hosting service.</p>
|
||||
<p><a href="https://twitter.com/orchardup">Follow us on Twitter</a> to keep up to date with Fig and other Docker news.</p>
|
||||
<p>Fig is a project from <a href="https://www.docker.com">Docker</a>.</p>
|
||||
|
||||
<div class="badges">
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=orchardup&repo=fig&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="100" height="20"></iframe>
|
||||
|
|
|
|||
7
yml.html
7
yml.html
|
|
@ -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?20140806312262093609022">
|
||||
<link rel="stylesheet" type="text/css" href="css/fig.css?20140807310288269723058">
|
||||
<link rel="canonical" href="http://www.fig.sh/yml.html">
|
||||
</head>
|
||||
<body>
|
||||
|
|
@ -151,11 +151,10 @@ privileged: true
|
|||
</ul>
|
||||
<ul class="nav">
|
||||
<li><a href="https://github.com/orchardup/fig">Fig on GitHub</a></li>
|
||||
<li><a href="http://webchat.freenode.net/?channels=%23orchardup&uio=d4">#orchardup on Freenode</a></li>
|
||||
<li><a href="http://webchat.freenode.net/?channels=%23docker&uio=d4">#docker on Freenode</a></li>
|
||||
</ul>
|
||||
|
||||
<p>Fig is a project from <a href="https://www.orchardup.com">Orchard</a>, a Docker hosting service.</p>
|
||||
<p><a href="https://twitter.com/orchardup">Follow us on Twitter</a> to keep up to date with Fig and other Docker news.</p>
|
||||
<p>Fig is a project from <a href="https://www.docker.com">Docker</a>.</p>
|
||||
|
||||
<div class="badges">
|
||||
<iframe src="http://ghbtns.com/github-btn.html?user=orchardup&repo=fig&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="100" height="20"></iframe>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue