浏览代码

Updated docker-compose to v3, updated readme

Mark Shust 8 年之前
父节点
当前提交
89d28fcbb9
共有 4 个文件被更改,包括 88 次插入48 次删除
  1. 21 0
      README.md
  2. 19 8
      docker-compose.override.yml.dist
  3. 47 39
      docker-compose.yml
  4. 1 1
      env/setup.env

+ 21 - 0
README.md

@@ -72,6 +72,7 @@ docker-compose exec phpfpm ./bin/magento
 ```
 ```
 
 
 or with straight Docker command:
 or with straight Docker command:
+
 ```
 ```
 docker exec NAME_OF_PHPFPM_CONTAINER ./bin/magento
 docker exec NAME_OF_PHPFPM_CONTAINER ./bin/magento
 ```
 ```
@@ -92,3 +93,23 @@ magento cache:flush
 You can copy `docker-compose.override.yml.dist` to `docker-compose.override.yml` and adjust environment variables, volume mounts etc in the `docker-compose.override.yml` file to avoid losing local configuration changes when you pull changes to this repository. 
 You can copy `docker-compose.override.yml.dist` to `docker-compose.override.yml` and adjust environment variables, volume mounts etc in the `docker-compose.override.yml` file to avoid losing local configuration changes when you pull changes to this repository. 
 
 
 Docker Compose will automatically read any of the values you define in the file. See [this link](https://docs.docker.com/compose/extends/#/understanding-multiple-compose-files) for more information about the override file. 
 Docker Compose will automatically read any of the values you define in the file. See [this link](https://docs.docker.com/compose/extends/#/understanding-multiple-compose-files) for more information about the override file. 
+
+
+## Troubleshooting
+
+### Setup Error
+
+A common error when running setup is receiving this error:
+
+```
+SQLSTATE[HY000] [2002] Connection refused
+
+  [InvalidArgumentException]
+  Parameter validation failed
+```
+
+If you receive this error, it's because the database driver has not initialized before the setup script commences execution. The easy fix for this is to run the setup command again immediately after this error:
+
+### PHP 7.1 Unusable
+
+[PHP 7.1 will not be supported until Magento 2.2](https://github.com/magento/magento2/issues/5880)

+ 19 - 8
docker-compose.override.yml.dist

@@ -5,12 +5,23 @@
 #
 #
 # Example showing how you can enable composer support in this file:
 # Example showing how you can enable composer support in this file:
 #
 #
-#appdata:
-#  volumes:
-#    - ~/.composer:/var/www/.composer
-#    - ./html/app/code:/var/www/html/app/code
-#    - ./html/app/design:/var/www/html/app/design
+#version: "3"
 #
 #
-#setup:
-#  environment:
-#    - M2SETUP_USE_ARCHIVE=false
+#services:
+#  app:
+#    volumes:
+#      - appdata:/var/www/html
+#      - ~/.composer:/var/www/.composer
+#      - ./html/app/code:/var/www/html/app/code
+#      - ./html/app/design:/var/www/html/app/design
+#
+#  phpfpm:
+#    volumes:
+#      - appdata:/var/www/html
+#      - ~/.composer:/var/www/.composer
+#      - ./html/app/code:/var/www/html/app/code
+#      - ./html/app/design:/var/www/html/app/design
+#
+#  setup:
+#    environment:
+#      - M2SETUP_USE_ARCHIVE=false

+ 47 - 39
docker-compose.yml

@@ -1,46 +1,54 @@
 # Mage Inferno Docker Compose (https://github.com/mageinferno/magento2-docker-compose)
 # Mage Inferno Docker Compose (https://github.com/mageinferno/magento2-docker-compose)
-# Version 6.0.0
+# Version 7.0.0
 
 
-app:
-  image: mageinferno/magento2-nginx:1.11-1
-  links:
-    - phpfpm
-    - db
-  volumes_from:
-    - appdata
-  ports:
-    - 8000:80
+version: "3"
 
 
-appdata:
-  image: tianon/true
-  volumes:
-    - /var/www/html
+services:
+  app:
+    image: mageinferno/magento2-nginx:1.11-1
+    links:
+      - db
+      - phpfpm
+    volumes:
+      - appdata:/var/www/html
+    ports:
+      - 8000:80
+    networks:
+      - www
 
 
-phpfpm:
-  image: mageinferno/magento2-php:7.0-fpm-1
-  links:
-    - db
-  volumes_from:
-    - appdata
+  phpfpm:
+    image: mageinferno/magento2-php:7.0-fpm-1
+    links:
+      - db
+    volumes:
+      - appdata:/var/www/html
+    networks:
+      - www
 
 
-db:
-  image: percona:5.7
-  volumes_from:
-    - dbdata
-  ports:
-    - 8001:3306
-  env_file: env/mysql.env
+  db:
+    image: percona:5.7
+    volumes:
+      - dbdata:/var/lib/mysql
+    ports:
+      - 8001:3306
+    networks:
+      - www
+    env_file: env/mysql.env
 
 
-dbdata:
-  image: tianon/true
-  volumes:
-    - /var/lib/mysql
+  setup:
+    image: mageinferno/magento2-php:7.0-fpm-1
+    command: /usr/local/bin/mage-setup
+    links:
+      - db
+    volumes:
+      - appdata:/var/www/html
+    networks:
+      - www
+    env_file: env/setup.env
 
 
-setup:
-  image: mageinferno/magento2-php:7.0-fpm-1
-  command: /usr/local/bin/mage-setup
-  links:
-    - db
-  volumes_from:
-    - appdata
-  env_file: env/setup.env
+volumes:
+  dbdata:
+  appdata:
+
+networks:
+  www:

+ 1 - 1
env/setup.env

@@ -14,4 +14,4 @@ M2SETUP_TIMEZONE=America/New_York
 M2SETUP_USE_SAMPLE_DATA=false
 M2SETUP_USE_SAMPLE_DATA=false
 M2SETUP_USE_ARCHIVE=true
 M2SETUP_USE_ARCHIVE=true
 M2SETUP_USE_COMPOSER_ENTERPRISE=false
 M2SETUP_USE_COMPOSER_ENTERPRISE=false
-M2SETUP_VERSION=2.1.5
+M2SETUP_VERSION=2.1.6