Просмотр исходного кода

Update guides to use v2 config format.

Signed-off-by: Daniel Nephin <[email protected]>
Daniel Nephin 9 лет назад
Родитель
Сommit
8d7b1e9047
4 измененных файлов с 54 добавлено и 45 удалено
  1. 13 11
      docs/django.md
  2. 13 10
      docs/gettingstarted.md
  3. 13 11
      docs/rails.md
  4. 15 13
      docs/wordpress.md

+ 13 - 11
docs/django.md

@@ -72,17 +72,19 @@ and a `docker-compose.yml` file.
 
 9. Add the following configuration to the file.
 
-        db:
-          image: postgres
-        web:
-          build: .
-          command: python manage.py runserver 0.0.0.0:8000
-          volumes:
-            - .:/code
-          ports:
-            - "8000:8000"
-          links:
-            - db
+        version: '2'
+        services:
+          db:
+            image: postgres
+          web:
+            build: .
+            command: python manage.py runserver 0.0.0.0:8000
+            volumes:
+              - .:/code
+            ports:
+              - "8000:8000"
+            depends_on:
+              - db
 
     This file defines two services: The `db` service and the `web` service.
 

+ 13 - 10
docs/gettingstarted.md

@@ -95,16 +95,19 @@ Define a set of services using `docker-compose.yml`:
 1. Create a file called docker-compose.yml in your project directory and add
    the following:
 
-        web:
-          build: .
-          ports:
-           - "5000:5000"
-          volumes:
-           - .:/code
-          links:
-           - redis
-        redis:
-          image: redis
+
+        version: '2'
+        services:
+          web:
+            build: .
+            ports:
+             - "5000:5000"
+            volumes:
+             - .:/code
+            depends_on:
+             - redis
+          redis:
+            image: redis
 
 This Compose file defines two services, `web` and `redis`. The web service:
 

+ 13 - 11
docs/rails.md

@@ -43,17 +43,19 @@ You'll need an empty `Gemfile.lock` in order to build our `Dockerfile`.
 
 Finally, `docker-compose.yml` is where the magic happens. This file describes the services that comprise your app (a database and a web app), how to get each one's Docker image (the database just runs on a pre-made PostgreSQL image, and the web app is built from the current directory), and the configuration needed to link them together and expose the web app's port.
 
-    db:
-      image: postgres
-    web:
-      build: .
-      command: bundle exec rails s -p 3000 -b '0.0.0.0'
-      volumes:
-        - .:/myapp
-      ports:
-        - "3000:3000"
-      links:
-        - db
+    version: '2'
+    services:
+      db:
+        image: postgres
+      web:
+        build: .
+        command: bundle exec rails s -p 3000 -b '0.0.0.0'
+        volumes:
+          - .:/myapp
+        ports:
+          - "3000:3000"
+        depends_on:
+          - db
 
 ### Build the project
 

+ 15 - 13
docs/wordpress.md

@@ -41,19 +41,21 @@ and WordPress.
 Next you'll create a `docker-compose.yml` file that will start your web service
 and a separate MySQL instance:
 
-    web:
-      build: .
-      command: php -S 0.0.0.0:8000 -t /code
-      ports:
-        - "8000:8000"
-      links:
-        - db
-      volumes:
-        - .:/code
-    db:
-      image: orchardup/mysql
-      environment:
-        MYSQL_DATABASE: wordpress
+    version: '2'
+    services:
+      web:
+        build: .
+        command: php -S 0.0.0.0:8000 -t /code
+        ports:
+          - "8000:8000"
+        depends_on:
+          - db
+        volumes:
+          - .:/code
+      db:
+        image: orchardup/mysql
+        environment:
+          MYSQL_DATABASE: wordpress
 
 A supporting file is needed to get this working. `wp-config.php` is
 the standard WordPress config file with a single change to point the database