Git Product home page Git Product logo

docker-magento2's People

Contributors

adam-paterson avatar ashsmith avatar avra911 avatar brideo avatar janmyszkier avatar lambovg avatar nicobatty avatar punkstar avatar raivisdejus avatar tgerulaitis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-magento2's Issues

Increase fastcgi buffer size

Ran into an issue where a store had a large response body, and nginx couldn't handle the request. Solution was to bump the buffer size.

fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;

Unable to send mail.

I seem to be unable to send mail!

Steps to reproduce:

docker run --hostname="awesome.hostname.com" --name=phpfpmtest -d -e ENABLE_SENDMAIL=true meanbee/magento2-php:7.0-fpm
docker exec -it phpfpmtest php -r "mail('[email protected]', 'test', 'test');"

Then check the logs:

docker logs phpfpmtest
Starting Mail Transport Agent (MTA): sendmail.
[14-Feb-2017 11:22:08] NOTICE: fpm is running, pid 1
[14-Feb-2017 11:22:08] NOTICE: ready to handle connections
[14-Feb-2017 11:22:09] ALERT: oops, unknown child (68) exited with code 0. Please open a bug report (https://bugs.php.net).

The ALERT comes up after attempting to send mail.

Further debugging of /var/spool/mqueue/ led me to find the following: MDeferred: Name server: ashsmith.io.: host name lookup failure.

This made me think it was a configuration issue with my DNS. If I run dig ashsmith.io I get no MX records. Same with meanbee.com (I've also tried sending mail to my meanbee email).

Any ideas?

Make varnish accesable on 80 port by default

Hi,

Starting the container, it was not available from the host in docker-compose.yml To make it available I had to change varnish container config from

ports:
      - 80

to


ports:
      - 80:80

Quickstart instructions yield errors

Started with the Quick Start to see how easy it was to get the base up and running and ran into the following errors:

Installing magento/project-community-edition (2.1.7)


  [InvalidArgumentException]
  Project directory /var/www/magento/ is not empty.


create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<directory>] [<version>]

Install Magento
chmod: cannot access '/var/www/magento/bin/magento': No such file or directory
sudo: /var/www/magento/bin/magento: command not found
chmod: cannot access '/var/www/magento/bin/magento': No such file or directory
sudo: /var/www/magento/bin/magento: command not found
chmod: cannot access '/var/www/magento/bin/magento': No such file or directory
sudo: /var/www/magento/bin/magento: command not found
Fixing file permissions..
find: `/var/www/magento/pub': No such file or directory
find: `/var/www/magento/pub': No such file or directory
find: `/var/www/magento/var/generation': No such file or directory

Also I noticed it was attempting to download CE, yet we are running EE, is there a setting to change this?

Cannot connect to http://magento2.docker/

I followed the guide till the end and started the docker. Here is the status for docker-compose ps

             Name                           Command               State                Ports              
---------------------------------------------------------------------------------------------------------
dockermagento2master_appdata_1   /true                            Exit 0                                  
dockermagento2master_cli_1       /usr/local/bin/docker-envi ...   Up                                      
dockermagento2master_cron_1      /usr/local/bin/docker-envi ...   Up                                      
dockermagento2master_db_1        docker-entrypoint.sh mysqld      Up       0.0.0.0:32784->3306/tcp        
dockermagento2master_dbdata_1    /true                            Exit 0                                  
dockermagento2master_fpm_1       /usr/local/bin/docker-envi ...   Up       0.0.0.0:32785->9000/tcp        
dockermagento2master_varnish_1   /bin/sh -c /start.sh             Up       0.0.0.0:32783->80/tcp          
dockermagento2master_web_1       /usr/local/bin/docker-envi ...   Up       443/tcp, 0.0.0.0:32782->80/tcp 

But in the browser I opened: http://magento2.docker/ just show me that the website cannot be reached.

I am using Mac OS Sierra!

Don't assume nginx needs a VIRTUAL_HOST

There are situations (such as when you're using Varnish) where you don't need a VIRTUAL_HOST defined. Defining it causes the docker-gen container to output an empty upstream, breaking nginx and not applying configuration.

Understanding composer.env files vars

Maybe this is a noob question but ... what the following parameters at composer.env means exactly?

COMPOSER_GITHUB_TOKEN=0000000000000000000000000000000000000000
COMPOSER_MAGENTO_USERNAME=00000000000000000000000000000000
COMPOSER_MAGENTO_PASSWORD=00000000000000000000000000000000

Would be nice if you add kind of clue for noob likes me.

Magento not being set to use Varnish

Given this Magento-Varnish setup, Magento isn't actually aware of Varnish's existence. If you go to Stores -> Configuration -> Full Page Cache -> Caching Application in the admin panel, you will see the setting set to "Built-In Cache" as opposed to being set to "Varnish Cache". As such, the following are occurring:

  • Magento is not communicating to Varnish. As such, if custom code determines that a page which normally would be flagged should not be flagged, Magento has no way of telling Varnish not to cache it
  • Magento is still caching pages in the built-in cache while Varnish also caches pages

Was this the intended setup? It seems odd that Varnish would be included in this stack, but that Magento would not be set to use it.

Kubernetes Support

I hope to add kubernetes support to this repo by creating a local helm Chart that includes the resources created within docker-compose. I intend to create a kubernetes directory at the root of this repo followed by a directory structure something along the lines of the following

...
kubernetes
โ”œโ”€โ”€ Chart.yaml
โ”œโ”€โ”€ templates
โ”‚ย ย  โ”œโ”€โ”€ NOTES.txt
โ”‚ย ย  โ”œโ”€โ”€ _helpers.tpl
โ”‚ย ย  โ”œโ”€โ”€ RESOURCES-YAML-*.yaml
โ””โ”€โ”€ values.yaml

This would allow deployments into a kubernetes cluster by executing something along the lines of

helm package .
helm install

Static files don't load - 404 error

Accessing http://hostname/static/version1484567756/_requirejs/frontend/Magento/luma/en_US/requirejs-config.js

results with an error:

Unable to resolve the source file for '_requirejs/frontend/Magento/luma/en_US/requirejs-config.js'
#0 /var/www/magento/vendor/magento/framework/App/StaticResource.php(97): Magento\Framework\View\Asset\File->getSourceFile()
#1 /var/www/magento/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\StaticResource->launch()
#2 /var/www/magento/pub/static.php(13): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\StaticResource))
#3 {main}

It is caused by wrong nginx configuration for location /static/ location /static/ {
I copied this block from nginx.conf.sample and now it seems to work correctly.

Setup Varnish

Magento 2 comes out of the box with varnish now, it might be useful to have the option to run a varnish image. Apparently it's lightning fast!

I'm happy to implement if it gets signed off.

Nginx not running on Ubuntu 16

Hi Nick,

Really loving this setup but having an issue running it on a ubuntu 16 machine. Essentially it seems like nginx server does not startup after bringing up the containers. I dont have a lot of experience using docker as a whole so not sure if I am missing something here. I have used this same setup on a mac using dinghy and works with no issues.

Are there any issue running this with Ubuntu you are aware off?

Cheers mate,
doug

how to fix this `timed out` issue?

โžœ  docker-magento2 git:(master) docker-compose up   
Starting dockermagento2_dbdata_1
Starting dockermagento2_cache_1
Starting dockermagento2_clusterdata_1

ERROR: for db  UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)
ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information.
If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 60).

Add "install extension" script

We use a script like the following quite a lot. Would be good to have it bundled into the image:

#!/bin/bash

MAGENTO_ROOT="/magento"
PHP="/usr/local/bin/php"
COMPOSER="$PHP /usr/local/bin/composer"

MODULE_NAME="Meanbee_Extension"
COMPOSER_NAME="meanbee/extension"

MAGENTO_TOOL="magento-command"

cd $MAGENTO_ROOT

# This is required because Magento doesn't support the path type in composer
# this is a hack.
ln -s /src/ src

$COMPOSER config repositories.extension path /src
$COMPOSER require $COMPOSER_NAME "*"

# Required due to us using the "path" type for the repository
$COMPOSER require "composer/composer" "1.0.0-alpha11 as 1.0.0-alpha10"

$MAGENTO_TOOL module:enable $MODULE_NAME
$MAGENTO_TOOL setup:upgrade
$MAGENTO_TOOL setup:static-content:deploy
$MAGENTO_TOOL cache:flush
$MAGENTO_TOOL deploy:mode:set developer

Fixing user permissions is very slow

Running any command when UPDATE_UID_GID is set takes orders of magnitude more time, once Magento is downloaded and installed:

> time docker-compose run --rm cli echo "Done"
Starting magento2environment_appdata_1
Starting magento2environment_dbdata_1
Updating www-data uid and gid
Docker: uid = 501, gid = 20
Incumbent: user = , group = dialout
Xdebug is enabled
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
Running composer as root/super user is highly discouraged as packages, plugins and scripts cannot always be trusted
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
Running composer as root/super user is highly discouraged as packages, plugins and scripts cannot always be trusted
Done

real    1m34.164s
user    0m0.402s
sys 0m0.180s

The shell output just hangs at the Incumbent line, probably trying to enumerate every file in Magento and update the permissions on it.

Automatically set the root directory for Magerun2

Magerun2 is installed on the CLI image, but does not recognise the $MAGENTO_ROOT environment variable for the Magento directory.

We should add a wrapper script like we have for M1 images to automatically configure Magerun2 to run as www-data and in the right directory.

howto interact with database

Thanks for your effort on this package! I have the setup up and running on a remote host, and would like to import a database dump to the MariaDB instance.. but I am at a loss as to how I should go about this?

Where can I run mysqldump? Do I have to attach to the mariadb container, use docker exec, or run from another context entirely? Do I transfer dump files to the db_1 or dbdata_1 container?

I realize these might be generic docker questions, but some usage examples would make this repo a lot more accessible to people wanting to explore docker multi container setups.

root user issue on windows?

I followed the readme file as vanilla as possible. only adding magento and github keys.

>docker-compose ps
          Name                        Command                State             Ports
---------------------------------------------------------------------------------------------
dockermagento2_appdata_1   /true                            Exit 0
dockermagento2_cli_1       /usr/local/bin/docker-envi ...   Exit 0
dockermagento2_cron_1      /usr/local/bin/docker-envi ...   Up
dockermagento2_db_1        docker-entrypoint.sh mysqld      Up        0.0.0.0:32775->3306/tcp
dockermagento2_dbdata_1    /true                            Exit 0
dockermagento2_fpm_1       /usr/local/bin/docker-envi ...   Exit 78
dockermagento2_varnish_1   /bin/sh -c /start.sh             Up        0.0.0.0:32773->80/tcp
dockermagento2_web_1       /usr/local/bin/docker-envi ...   Exit 1

 >docker-compose --version
docker-compose version 1.11.2, build f963d76f


>docker-compose logs
fpm_1      | usermod: user root is currently used by process 1
cli_1      | usermod: user root is currently used by process 1
cron_1     | May 19 06:21:01 magento2-cron CRON[164]: (www-data) CMD (/usr/local/bin/php /var/www/magento/bin/magento setup:cron:run >> /var/www/magento/var/log/setup.cron.log)
db_1       | 2017-05-19  5:51:16 139989161232320 [Note] /usr/sbin/mysqld (mysqld 10.1.23-MariaDB-1~jessie) starting as process 88 ...
fpm_1      | usermod: UID '0' already exists
cli_1      | usermod: UID '0' already exists
cron_1     | May 19 06:21:01 magento2-cron CRON[166]: (www-data) CMD (/usr/local/bin/php /var/www/magento/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /var/www/magento/var/log/magento.cron.log)
db_1       | 2017-05-19  5:51:16 139989161232320 [Note] InnoDB: Using mutexes to ref count buffer pool pages
fpm_1      | Starting Mail Transport Agent (MTA): sendmail.
cli_1      | groupmod: GID '990' already exists
cron_1     | May 19 06:21:01 magento2-cron CRON[165]: (www-data) CMD (/usr/local/bin/php /var/www/magento/update/cron.php >> /var/www/magento/var/log/update.cron.log)
db_1       | 2017-05-19  5:51:16 139989161232320 [Note] InnoDB: The InnoDB memory heap is disabled
fpm_1      | [19-May-2017 06:15:32] ERROR: [pool www] please specify user and group other than root
cli_1      | Starting enhanced syslogd: rsyslogd.
cron_1     | May 19 06:22:01 magento2-cron CRON[176]: (www-data) CMD (/usr/local/bin/php /var/www/magento/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /var/www/magento/var/log/magento.cron.log)
db_1       | 2017-05-19  5:51:16 139989161232320 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
fpm_1      | [19-May-2017 06:15:32] ERROR: [pool www] please specify user and group other than root
cli_1      | Starting Mail Transport Agent (MTA): sendmail.
cron_1     | May 19 06:22:01 magento2-cron CRON[179]: (www-data) CMD (/usr/local/bin/php /var/www/magento/update/cron.php >> /var/www/magento/var/log/update.cron.log)
db_1       | 2017-05-19  5:51:16 139989161232320 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
fpm_1      | [19-May-2017 06:15:32] ERROR: FPM initialization failed
cli_1      | Do not run Composer as root/super user! See https://getcomposer.org/root for details
cron_1     | May 19 06:22:01 magento2-cron CRON[180]: (www-data) CMD (/usr/local/bin/php /var/www/magento/bin/magento setup:cron:run >> /var/www/magento/var/log/setup.cron.log)
db_1       | 2017-05-19  5:51:16 139989161232320 [Note] InnoDB: Compressed tables use zlib 1.2.8
fpm_1      | [19-May-2017 06:15:32] ERROR: FPM initialization failed
cli_1      | Do not run Composer as root/super user! See https://getcomposer.org/root for details
db_1       | 2017-05-19  5:51:16 139989161232320 [Note] InnoDB: Using Linux native AIO
fpm_1      | Updating www-data uid and gid

Seems like complains about user root.
I ran it under my normal user and not admin user in windows.

Modifying Dockerfile -- no result?

Hi,

I want to add own script to "run cli".

So I've:

  1. Created 'magento-permissions' script inside 7.0-cli/bin/
  2. Modified 7.0-cli/Dockerfile as below:

....
ADD bin/* /usr/local/bin/
added -> ADD bin/magento-permissions /usr/local/bin/magento-permissions
....

  1. Cleaned /var/lib/* docker cache and re-installed whole docker-engine to ensure that I have no-cached version

But after building from scratch (docker-compose run cli magento-installer, docker-compose up -d, docker-compose restart):

/usr/local/bin/docker-environment: line 49: exec: magento-permissions: not found

Could you help me: how to add own script to use inside "run cli"?

Thanks in advance,

Use the run mode in the CLI image

At the moment we set the run mode for Magento in the Nginx configuration, but we don't do anything on the CLI image. This means that we could have Magento running in one mode and the CLI magento command running in another, something that might cause issues.

Recent usage?

Has anyone used this repository recently?

I'm getting several errors when trying to bring it up:

cli_1      | Starting Mail Transport Agent (MTA): sendmail.
cli_1      | Do not run Composer as root/super user! See https://getcomposer.org/root for details
cli_1      | Do not run Composer as root/super user! See https://getcomposer.org/root for details
magento2_cli_1 exited with code 0

Apparently, varnish fails earlier as well:

varnish_1  | bind(): Cannot assign requested address
varnish_1  | child (16) Started
varnish_1  | Child (16) said Child starts

(I don't have anything on 80, and the docker daemon runs as root).

Any hint please?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.