update
This commit is contained in:
parent
9750ae1958
commit
16329bda7a
8 changed files with 11 additions and 159 deletions
3
cli.html
3
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?20140127042195880413617">
|
||||
<link rel="stylesheet" type="text/css" href="css/fig.css?20140127042058357943413">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
|
|
@ -96,7 +96,6 @@ For example:</p>
|
|||
<li><a href="install.html">Install</a></li>
|
||||
<li><a href="rails.html">Get started with Rails</a></li>
|
||||
<li><a href="django.html">Get started with Django</a></li>
|
||||
<li><a href="wordpress.html">Get started with Wordpress</a></li>
|
||||
</ul>
|
||||
<ul class="nav">
|
||||
<li>Reference:</li>
|
||||
|
|
|
|||
|
|
@ -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?20140127042195880413617">
|
||||
<link rel="stylesheet" type="text/css" href="css/fig.css?20140127042058357943413">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
|
|
@ -67,8 +67,8 @@ Dockerfile fig.yml figexample manage.py requirements
|
|||
'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'),
|
||||
'HOST': os.environ.get('MYAPP_DB_1_PORT_5432_TCP_ADDR'),
|
||||
'PORT': os.environ.get('MYAPP_DB_1_PORT_5432_TCP_PORT'),
|
||||
}
|
||||
}
|
||||
</code></pre></div>
|
||||
|
|
@ -107,7 +107,6 @@ myapp_web_1 | Quit the server with CONTROL-C.
|
|||
<li><a href="install.html">Install</a></li>
|
||||
<li><a href="rails.html">Get started with Rails</a></li>
|
||||
<li><a href="django.html">Get started with Django</a></li>
|
||||
<li><a href="wordpress.html">Get started with Wordpress</a></li>
|
||||
</ul>
|
||||
<ul class="nav">
|
||||
<li>Reference:</li>
|
||||
|
|
|
|||
3
env.html
3
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?20140127042195880413617">
|
||||
<link rel="stylesheet" type="text/css" href="css/fig.css?20140127042058357943413">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
|
|
@ -53,7 +53,6 @@ Fully qualified container name, e.g. <code>DB_1_NAME=/myapp_web_1/myapp_db_1</co
|
|||
<li><a href="install.html">Install</a></li>
|
||||
<li><a href="rails.html">Get started with Rails</a></li>
|
||||
<li><a href="django.html">Get started with Django</a></li>
|
||||
<li><a href="wordpress.html">Get started with Wordpress</a></li>
|
||||
</ul>
|
||||
<ul class="nav">
|
||||
<li>Reference:</li>
|
||||
|
|
|
|||
|
|
@ -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?20140127042195880413617">
|
||||
<link rel="stylesheet" type="text/css" href="css/fig.css?20140127042058357943413">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
|
|
@ -171,7 +171,6 @@ figtest_web_1 /bin/sh -c python app.py Up 5000->5000/tcp
|
|||
<li><a href="install.html">Install</a></li>
|
||||
<li><a href="rails.html">Get started with Rails</a></li>
|
||||
<li><a href="django.html">Get started with Django</a></li>
|
||||
<li><a href="wordpress.html">Get started with Wordpress</a></li>
|
||||
</ul>
|
||||
<ul class="nav">
|
||||
<li>Reference:</li>
|
||||
|
|
|
|||
|
|
@ -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?20140127042195880413617">
|
||||
<link rel="stylesheet" type="text/css" href="css/fig.css?20140127042058357943413">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
|
|
@ -47,7 +47,6 @@ $ docker-osx shell
|
|||
<li><a href="install.html">Install</a></li>
|
||||
<li><a href="rails.html">Get started with Rails</a></li>
|
||||
<li><a href="django.html">Get started with Django</a></li>
|
||||
<li><a href="wordpress.html">Get started with Wordpress</a></li>
|
||||
</ul>
|
||||
<ul class="nav">
|
||||
<li>Reference:</li>
|
||||
|
|
|
|||
|
|
@ -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?20140127042195880413617">
|
||||
<link rel="stylesheet" type="text/css" href="css/fig.css?20140127042058357943413">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
|
|
@ -78,8 +78,8 @@ Rakefile db test
|
|||
pool: 5
|
||||
username: docker
|
||||
password: docker
|
||||
host: <%= ENV.fetch('DB_1_PORT_5432_TCP_ADDR', 'localhost') %>
|
||||
port: <%= ENV.fetch('DB_1_PORT_5432_TCP_PORT', '5432') %>
|
||||
host: <%= ENV.fetch('MYAPP_DB_1_PORT_5432_TCP_ADDR', 'localhost') %>
|
||||
port: <%= ENV.fetch('MYAPP_DB_1_PORT_5432_TCP_PORT', '5432') %>
|
||||
|
||||
test:
|
||||
<<: *default
|
||||
|
|
@ -114,7 +114,6 @@ myapp_web_1 | [2014-01-17 17:16:29] INFO WEBrick::HTTPServer#start: pid=1 port=
|
|||
<li><a href="install.html">Install</a></li>
|
||||
<li><a href="rails.html">Get started with Rails</a></li>
|
||||
<li><a href="django.html">Get started with Django</a></li>
|
||||
<li><a href="wordpress.html">Get started with Wordpress</a></li>
|
||||
</ul>
|
||||
<ul class="nav">
|
||||
<li>Reference:</li>
|
||||
|
|
|
|||
141
wordpress.html
141
wordpress.html
|
|
@ -1,141 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-gb">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Getting started with Fig and Wordpress</title>
|
||||
<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?20140127042195880413617">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="logo mobile-logo">
|
||||
<a href="index.html">
|
||||
<img src="img/logo.png">
|
||||
Fig
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="content"><h1>Getting started with Fig and Wordpress</h1>
|
||||
|
||||
<p>Fig makes it nice and easy to run Wordpress in an isolated environment. <a href="install.html">Install Fig</a>, then write a <code>Dockerfile</code> which installs PHP and Wordpress:</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text">FROM orchardup/php5
|
||||
|
||||
ADD http://wordpress.org/wordpress-3.8.1.tar.gz /wordpress.tar.gz
|
||||
RUN tar -xzf /wordpress.tar.gz
|
||||
ADD wp-config.php /wordpress/wp-config.php
|
||||
|
||||
ADD router.php /router.php
|
||||
</code></pre></div>
|
||||
<p>Next up, <code>fig.yml</code> starts our web service and a separate MySQL instance:</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text">web:
|
||||
build: .
|
||||
command: php -S 0.0.0.0:8000 -t /wordpress
|
||||
ports:
|
||||
- 8000:8000
|
||||
links:
|
||||
- db
|
||||
db:
|
||||
image: orchardup/mysql
|
||||
ports:
|
||||
- 3306:3306
|
||||
environment:
|
||||
MYSQL_DATABASE: wordpress
|
||||
</code></pre></div>
|
||||
<p>Our Dockerfile relies on two supporting files - first up, <code>wp-config.php</code> is the standard Wordpress config file with a single change to make it read the MySQL host and port from the environment variables passed in by Fig:</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text"><?php
|
||||
define('DB_NAME', 'wordpress');
|
||||
define('DB_USER', 'root');
|
||||
define('DB_PASSWORD', '');
|
||||
define('DB_HOST', getenv("DB_1_PORT_3306_TCP_ADDR") . ":" . getenv("DB_1_PORT_3306_TCP_PORT"));
|
||||
define('DB_CHARSET', 'utf8');
|
||||
define('DB_COLLATE', '');
|
||||
|
||||
define('AUTH_KEY', 'put your unique phrase here');
|
||||
define('SECURE_AUTH_KEY', 'put your unique phrase here');
|
||||
define('LOGGED_IN_KEY', 'put your unique phrase here');
|
||||
define('NONCE_KEY', 'put your unique phrase here');
|
||||
define('AUTH_SALT', 'put your unique phrase here');
|
||||
define('SECURE_AUTH_SALT', 'put your unique phrase here');
|
||||
define('LOGGED_IN_SALT', 'put your unique phrase here');
|
||||
define('NONCE_SALT', 'put your unique phrase here');
|
||||
|
||||
$table_prefix = 'wp_';
|
||||
define('WPLANG', '');
|
||||
define('WP_DEBUG', false);
|
||||
|
||||
if ( !defined('ABSPATH') )
|
||||
define('ABSPATH', dirname(__FILE__) . '/');
|
||||
|
||||
require_once(ABSPATH . 'wp-settings.php');
|
||||
</code></pre></div>
|
||||
<p>Finally, <code>router.php</code> tells PHP's built-in web server how to run Wordpress:</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text"><?php
|
||||
|
||||
$root = $_SERVER['DOCUMENT_ROOT'];
|
||||
chdir($root);
|
||||
$path = '/'.ltrim(parse_url($_SERVER['REQUEST_URI'])['path'],'/');
|
||||
set_include_path(get_include_path().':'.__DIR__);
|
||||
if(file_exists($root.$path))
|
||||
{
|
||||
if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== '/')
|
||||
$path = rtrim($path,'/').'/index.php';
|
||||
if(strpos($path,'.php') === false) return false;
|
||||
else {
|
||||
chdir(dirname($root.$path));
|
||||
require_once $root.$path;
|
||||
}
|
||||
}else include_once 'index.php';
|
||||
</code></pre></div>
|
||||
<p>With those four files in place, run <code>fig up</code> and it'll pull and build the images we need, and then start the web and database containers. You'll then be able to visit Wordpress and set it up by visiting <a href="http://localhost:8000">localhost:8000</a> - or <a href="http://localdocker:8000">localdocker:8000</a> if you're using docker-osx.</p>
|
||||
</div>
|
||||
|
||||
<div class="sidebar">
|
||||
<h1 class="logo">
|
||||
<a href="index.html">
|
||||
<img src="img/logo.png">
|
||||
Fig
|
||||
</a>
|
||||
</h1>
|
||||
|
||||
<ul class="nav">
|
||||
<li><a href="index.html">Home</a></li>
|
||||
<li><a href="install.html">Install</a></li>
|
||||
<li><a href="rails.html">Get started with Rails</a></li>
|
||||
<li><a href="django.html">Get started with Django</a></li>
|
||||
<li><a href="wordpress.html">Get started with Wordpress</a></li>
|
||||
</ul>
|
||||
<ul class="nav">
|
||||
<li>Reference:</li>
|
||||
<ul>
|
||||
<li><a href="yml.html">fig.yml</a></li>
|
||||
<li><a href="cli.html">Commands</a></li>
|
||||
<li><a href="env.html">Environment variables</a></li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul class="nav">
|
||||
<li><a href="https://github.com/orchardup/fig">Fig on GitHub</a></li>
|
||||
<li><a href="https://twitter.com/orchardup">Follow us on Twitter</a></li>
|
||||
<li><a href="http://webchat.freenode.net/?channels=%23orchardup&uio=d4">#orchardup on Freenode</a></li>
|
||||
</ul>
|
||||
|
||||
<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>
|
||||
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://orchardup.github.io/fig/">Tweet</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-43996733-3', 'orchardup.github.io');
|
||||
ga('send', 'pageview');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
3
yml.html
3
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?20140127042195880413617">
|
||||
<link rel="stylesheet" type="text/css" href="css/fig.css?20140127042058357943413">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
|
|
@ -65,7 +65,6 @@
|
|||
<li><a href="install.html">Install</a></li>
|
||||
<li><a href="rails.html">Get started with Rails</a></li>
|
||||
<li><a href="django.html">Get started with Django</a></li>
|
||||
<li><a href="wordpress.html">Get started with Wordpress</a></li>
|
||||
</ul>
|
||||
<ul class="nav">
|
||||
<li>Reference:</li>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue