meanbee / docker-magento2 Goto Github PK
View Code? Open in Web Editor NEW๐ณ Docker containers with all required Magento 2 dependencies installed available as FPM through Nginx and CLI
License: MIT License
๐ณ Docker containers with all required Magento 2 dependencies installed available as FPM through Nginx and CLI
License: MIT License
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;
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?
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
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?
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!
Varnish container started but i got error 503 backend fetched failed
I have searched a bit and find out varnish configuration need setup increase http_resp_hdr_len value
but i can't find a place where to put new value
My search : http://devdocs.magento.com/guides/v2.0/config-guide/varnish/tshoot-varnish-503.html
How to fix it ?
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.
We can pull across what was done on https://github.com/meanbee/docker-magento
Currently getting this error:
Zend_Mail_Transport_Exception: Unable to send mail.
The environment variables are sed
ded into place in various configuration files. If an environment variable is not defined then the variable substitution string remains and results in a broken configuration file.
Rather than setting these auth details foreach product could we mount ~/.composer/auth.json
which is the standardised place for these credentials.
Probably because in 7.0-cli/bin/magento-installer:47 it only passes the parameter into Magento if it is empty.
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 2 will generate a random backend path by default. However, during the install command you can specify the --backend-frontname
flag to set a custom path.
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:
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.
We have this hard coded to the latest release candidate in the Dockerfiles of fpm and cli. When this goes stable then we should upgrade to the latest stable version.
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
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.
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.
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
โ 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).
The xdebug IDE key is currently hardcoded. It would be nice to allow support for other IDE's.
I'm getting a 502 error when I go to http://magento2.docker/.
How can I check the NGINX error logs?
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
Not sure if you saw my comment in issue #59?
The Magento installation command allows setting separate secure base URL with the --base-url-secure
parameter. magento-installer
should allow that too with an additional environment variable.
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.
Just so new installations are not stuck on 2.0.2 as it is currently set to.
This should be changed to 2.1.2
Hi,
After trying to make compose with your README I get:
Creating network "dockermagento2master_default" with the default driver
ERROR: 404 page not found
Any suggestion how to fix it?
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.
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.
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.
Hi,
I want to add own script to "run cli".
So I've:
....
ADD bin/* /usr/local/bin/
added -> ADD bin/magento-permissions /usr/local/bin/magento-permissions
....
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,
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.
It is possible to do this or upgrade in near future? In case i want to use more than one domain with multiple instance of version magento for test inside docker container
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.