Git Product home page Git Product logo

dockerized-magento's Introduction

Dockerized - Magento Community Edition 1.9.x

A dockerized version of "Magento Community Edition 1.9.x"

Requirements

If you are on Linux you should install

If you are running on Mac OS or Windows you can install the Docker Toolbox which contains docker, docker-compose and docker-machine.

Preparations

The web-server will be bound to your local ports 80 and 443. In order to access the shop you must add a hosts file entry for dockerized-magento.local.

For Linux Users

In order to access the shop you must add the domain name "dockerized-magento.local" to your hosts file (/etc/hosts). If you are using docker natively you can use this command:

sudo su
echo "127.0.0.1    dockerized-magento.local" >> /etc/hosts

For Mac Users

If you are using docker-machine you need to use the IP address of your virtual machine running docker:

docker-machine ls
docker-machine ip <name-of-your-docker-machine>
echo "192.168.99.100    dockerized-magento.local" >> /etc/hosts

docker-machine performance

For faster sync between your host system and the docker machine image I recommend that you activate NFS support for virtualbox: github.com/adlogix/docker-machine-nfs

docker-machine create --driver virtualbox nfsbox
docker-machine-nfs nfsbox

And to fix issues with filesystem permissions you can modify your NFS exports configuration:

  1. open /etc/exports and replace -mapall=$uid:$gid with -maproot=0
  2. sudo nfsd restart

Thanks to René Penner for figuring that out.

For Windows Users

I suppose it will work on Windows, but I have not tested it. And I suspect that the performance will not be great due to the slow file-sharing protocol between the Windows hosts and the VirtualBox VM.

Installation

  1. Make sure you have docker and docker-compose on your system
  2. Clone the repository
  3. Start the projects using ./magento start or docker-compose up
git clone https://github.com/andreaskoch/dockerized-magento.git && cd dockerized-magento
./magento start

During the first start of the project docker-compose will

  1. first build all docker-images referenced in the docker-compose.yml
  2. then start the containers
  3. and trigger the installer which will

Once the installation is finished the installer will print the URL and the credentials for the backend to the installer log:

...
installer_1      | phpMyAdmin: http://dockerized-magento.local:8080
installer_1      |  - Username: root
installer_1      |  - Password: pw
installer_1      |
installer_1      | Backend: http://dockerized-magento.local/admin
installer_1      |  - Username: admin
installer_1      |  - Password: password123
installer_1      |
installer_1      | Frontend: http://dockerized-magento.local/

Animation: Installation and first project start

Note: The build process and the installation process will take a while if you start the project for the first time. After that, starting and stoping the project will be a matter of seconds.

Usage

You can control the project using the built-in magento-script which is basically just a wrapper for docker and docker-compose that offers some convenience features:

./magento <action>

Available Actons

  • start: Starts the docker containers (and triggers the installation if magento is not yet installed)
  • stop: Stops all docker containers
  • restart: Restarts all docker containers and flushes the cache
  • status: Prints the status of all docker containers
  • stats: Displays live resource usage statistics of all containers
  • magerun: Executes magerun in the magento root directory
  • composer: Executes composer in the magento root directory
  • enter: Enters the bash of a given container type (e.g. php, mysql, ...)
  • destroy: Stops all containers and removes all data

Note: The magento-script is just a small wrapper around docker-compose. You can just use docker-compose directly.

Components

Overview

The dockerized Magento project consists of the following components:

The component-diagram should give you a general idea* how all components of the "dockerized Magento" project are connected:

Dockerized Magento: Component Diagram

* The diagram is just an attempt to visualize the dependencies between the different components. You can get the complete picture by studying the docker-compose file: docker-compose.yml

Even though the setup might seem complex, the usage is thanks to docker really easy.

If you are interested in a guide on how to dockerize a Magento shop yourself you can have a look at a blog-post of mine: Dockerizing Magento on AndyK Docs

Custom Configuration

All parameters of the Magento installation are defined via environment variables that are set in the docker-compose.yml file - if you want to tailor the Magento Shop installation to your needs you can do so by modifying the environment variables before you start the project.

If you have started the shop before you must repeat the installation process in order to apply changes:

  1. Modify the parameters in the docker-compose.yml
  2. Shutdown the containers and remove all data (./magento destroy)
  3. Start the containers again (./magento start)

Changing the domain name

I set the default domain name to dockerized-magento.local. To change the domain name replace dockerized-magento.local with your-domain.tld in the docker-compose.yml file:

installer:
  environment:
    DOMAIN: dockerized-magento.local

Using a different SSL certificate

By default I chose a dummy certificate (config/ssl/cert.pem). If you want to use a different certificate you can just override the key and cert with your own certificates.

Adapt Magento Installation Parameters

If you want to install Magento using your own admin-user or change the password, email-adreess or name you can change the environment variable of the installer that begin with ADMIN_:

  • ADMIN_USERNAME: The username of the admin user
  • ADMIN_FIRSTNAME: The first name of the admin user
  • ADMIN_LASTNAME: The last name of the admin user
  • ADMIN_PASSWORD: The password for the admin user
  • ADMIN_EMAIL: The email address of the admin user (Note: Make sure it has a valid syntax. Otherwise Magento will not install.)
  • ADMIN_FRONTNAME: The name of the backend route (e.g. http://dockerized-magento.local/admin)
installer:
  build: docker-images/installer
  environment:
		ADMIN_USERNAME: admin
		ADMIN_FIRSTNAME: Admin
		ADMIN_LASTNAME: Inistrator
		ADMIN_PASSWORD: password123
		ADMIN_FRONTNAME: admin
		ADMIN_EMAIL: [email protected]

Change the MySQL Root User Password

I chose a very weak passwords for the MySQL root-user. You can change it by modifying the respective environment variables for the mysql-container ... and installer because otherwise the installation will fail:

installer:
  environment:
    MYSQL_PASSWORD: <your-mysql-root-user-password>
mysql:
  environment:
    MYSQL_ROOT_PASSWORD: <your-mysql-root-user-password>

dockerized-magento's People

Contributors

andreaskoch avatar rishka avatar stefanorg avatar ziadsawalha 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

dockerized-magento's Issues

windows 10 nignix issue

ERROR: for nginx Cannot start service nginx: oci runtime error: rootfs_linux.go:53: mounting "/mnt/sda1/var/lib/docker/aufs/mnt/fb29dddc04468de8c4432f53e09a4ddfa7c45a4d380b91f09aa2ce6bce0db00f/etc/nginx/nginx.conf" to rootfs "/mnt/sda1/var/lib/docker/aufs/mnt/fb29dddc04468de8c4432f53e09a4ddfa7c45a4d380b91f09aa2ce6bce0db00f" caused "not a directory"
�[31mERROR�[0m: Encountered errors while bringing up the project.

Admin@DESKTOP-O87GU72 MINGW64 ~/m9docker/dockerized-magento (master)
$ docker-compose up
dockerizedmagento_cache_1 is up-to-date
dockerizedmagento_fullpagecache_1 is up-to-date
dockerizedmagento_mysql_1 is up-to-date
dockerizedmagento_sessions_1 is up-to-date
dockerizedmagento_solr_1 is up-to-date
dockerizedmagento_php_1 is up-to-date
Starting dockerizedmagento_nginx_1

ERROR: for nginx Cannot start service nginx: oci runtime error: rootfs_linux.go:53: mounting "/mnt/sda1/var/lib/docker/aufs/mnt/fb29dddc04468de8c4432f53e09a4ddfa7c45a4d380b91f09aa2ce6bce0db00f/etc/nginx/nginx.conf" to rootfs "/mnt/sda1/var/lib/docker/aufs/mnt/fb29dddc04468de8c4432f53e09a4ddfa7c45a4d380b91f09aa2ce6bce0db00f" caused "not a directory"
�[31mERROR�[0m: Encountered errors while bringing up the project.

Admin@DESKTOP-O87GU72 MINGW64 ~/m9docker/dockerized-magento (master)
$

AOE Scheduler Heartbeat Not Working?

@andreaskoch - When I goto System > Scheduler > Job Configuration ... I get a Magento notice that "No heartbeat task found. Check if cron is configured correctly. (See Instructions)"

I went to project root on staging server and used "sudo crontab -u www-data -e" to insert the following configuration (as directed by the instructions link:)

  • * * * * ! test -e /var/www/html/web/maintenance.flag && /bin/bash /var/www/html/web/scheduler_cron.sh --mode always
  • * * * * ! test -e /var/www/html/web/maintenance.flag && /bin/bash /var/www/html/web/scheduler_cron.sh --mode default

I still got the Magento notice. Tried "sudo service cron restart" and cron was restarted. Cleared cache...Still getting the same Magento notice.

Any ideas?

NGINX Config

Can you share which location we should be using to make changes to Nginx config files - /config/nginx or /docker-images/nginx ?

I wasn't able to figure out which set of config files were being after examining code (newbie :)

What if I just want to change a domain?

Thank you for the truly useful configurations, I'm quite enjoy to make these things automatically.

I don't want to lose the data, but destroy all of them, including the data container isn't fair if I'm just trying to change a domain...

Changed the domain and recreate the nginx container doesn't work.

Thanks

nginx issue in windows 10

Creating dockerizedmagento_solr_1
Creating dockerizedmagento_fullpagecache_1
Creating dockerizedmagento_sessions_1
Creating dockerizedmagento_cache_1
Creating dockerizedmagento_mysql_1
Creating dockerizedmagento_php_1
Creating dockerizedmagento_nginx_1

ERROR: for nginx Cannot start service nginx: oci runtime error: rootfs_linux.go:53: mounting "/mnt/sda1/var/lib/docker/aufs/mnt/6dc10df5fa48c5d8753491fe169d0e25d2b7eb109b8870a44cac784fadf573e0/etc/nginx/nginx.conf" to rootfs "/mnt/sda1/var/lib/docker/aufs/mnt/6dc10df5fa48c5d8753491fe169d0e25d2b7eb109b8870a44cac784fadf573e0" caused "not a directory"
�[31mERROR�[0m: Encountered errors while bringing up the project.

502 Bad Gateway nginx/1.11.3

Hi, someone know how fix this issue? I'm deploying with jwilder/nginx-proxy
https://github.com/jwilder/nginx-proxy

here my docker-compose.yml

thanks in advance! :)

installer:
  build: docker-images/installer
  environment:
    VIRTUAL_HOST: dockerized-magento.local,www.dockerized-magento.local
    HTTPS_METHOD: noredirect
    DOMAIN: dockerized-magento.local
    MAGENTO_ROOT: /var/www/html/web
    MYSQL_HOST: mysql
    MYSQL_DATABASE: magento
    MYSQL_USER: root
    MYSQL_PASSWORD: pw
    ADMIN_USERNAME: admin
    ADMIN_FIRSTNAME: Admin
    ADMIN_LASTNAME: Inistrator
    ADMIN_PASSWORD: password123
    ADMIN_FRONTNAME: admin
    ADMIN_EMAIL: [email protected]
    ENCRYPTIONKEY: 731aea833710535779fe8c7c49bc6c4d
  volumes_from:
    - nginx
  links:
    - "cache:rediscache"
    - "sessions:redissession"
    - "fullpagecache:redisfullpagecache"
    - "solr:solr"
    - "mysql:mysql"
nginx:
  image: jwilder/nginx-proxy
  ports:
    - "80:80"
    - "443:443"
  links:
    - "php"
  volumes:
    - /home/vagrant/up/proxy/vhost.d:/etc/nginx/vhost.d:ro
    - /home/vagrant/up/proxy/certs:/etc/nginx/certs
    - /var/run/docker.sock:/tmp/docker.sock:ro
  volumes_from:
    - php
php:
  build: docker-images/php
  links:
    - "cache:rediscache"
    - "sessions:redissession"
    - "fullpagecache:redisfullpagecache"
    - "solr:solr"
    - "mysql:mysql"
  volumes:
    - .:/var/www/html
mysql:
  image: mysql:5.5
  ports:
    - "3306:3306"
  environment:
    MYSQL_ROOT_PASSWORD: pw
  volumes:
    - ./data/mysql:/var/lib/mysql
solr:
  build: docker-images/solr
cache:
  image: redis:latest
fullpagecache:
  image: redis:latest
sessions:
  image: redis:latest

"./magento start" pending at: Setting up ca-certificates-java (20140324) ...

I've been trying it on 2 different Ubuntu systems.
It's always pending with this:

Setting up openjdk-7-jre:amd64 (7u91-2.6.3-1~deb8u1) ...
update-alternatives: using /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/policytool to provide /usr/bin/policytool (policytool) in auto mode
Setting up ca-certificates-java (20140324) ...

Docker Compose fails when pulling solr

Pulling solr (andreaskoch/dockerized-magento-solr:latest)...
ERROR: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

Any tips for getting around this? I'm excited to see how this can benefit a project I have

client 1.21 version too old when trying to get docker to run

Hi,

I get the following error when I try running docker-compose up:
ERROR: client version 1.21 is too old. Minimum supported API version is 1.24, please upgrade your client to a newer version

I have found a related issue docker/compose#4106 saying I should add like "version: '2.1'" to the docker-compose.yml file. I've used this before in other projects (and usually have "version" above my "services") but when I open this docker-compose.yml file, I see "installer: " instead of the "services: " I usually see.

I tried adding the "version: '2'" line anyway but that gets me the following error:

"Invalid top-level property "cache". Valid top-level sections for this Compose file are: version, services, networks, volumes, and extensions starting with "x-".
You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the services key, or omit the version key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/ "

Going to the documentation provided in the link above I expected to see something about "installer" possibilities but the documentation does not mention it.

I'm a bit stuck now. I'd love to get this up and running. Where should the version go and what type of docker-compose.yml is this?

I'm on Windows 10 professional, running docker version 18.03.1-ce and API version 1.37. I'm fairly new to Docker so any help with this issue is appreciated.

Failed to enable crypto

Hello guys,

I get this error:

installer_1      |   [Composer\Downloader\TransportException]                                                                                                    
installer_1      |   The "https://packages.firegento.com/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:  
installer_1      |   error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed                                                           
installer_1      |   Failed to enable crypto                                                                                                                     
installer_1      |   failed to open stream: operation failed  

Why this happens? Is the SSL module installed at the container?

Add phpMyAdmin to docker-compose.yml file

This is more of a heads-up than an issue, if you add the following to the end of the docker-compose.yml file users will have browser access to the db

 phpmyadmin:
   image: phpmyadmin/phpmyadmin
   links:
    - mysql:mysql
   ports:
     - 9191:80
  environment:
    MYSQL_USERNAME: root
    MYSQL_ROOT_PASSWORD: pw
     PMA_HOST: mysql

NOTE: 9191 is the host port http://localhost:9191 - will bring up phyMyAdmin

BTW: Thanks for dockerized-magento, its great for creating a test/learning environment!

ERROR: for nginx driver failed programming external connectivity on endpoint

WARNING: Image for service installer was built because it did not already exist. To rebuild this image you must use docker-compose build or docker-compose up --build.
Creating dockerizedmagento_mysql_1
Creating dockerizedmagento_fullpagecache_1
Creating dockerizedmagento_sessions_1
Creating dockerizedmagento_cache_1
Creating dockerizedmagento_solr_1
Creating dockerizedmagento_php_1
Creating dockerizedmagento_nginx_1

ERROR: for nginx driver failed programming external connectivity on endpoint dockerizedmagento_nginx_1 (f4231c1e80b680a8a59961cb3658c55d2b64cc3a3e980e09f8b94531a608892f): Error starting userland proxy: listen tcp 0.0.0.0:80: listen: address already in use
Traceback (most recent call last):
File "", line 3, in
File "compose/cli/main.py", line 63, in main
AttributeError: 'ProjectError' object has no attribute 'msg'
docker-compose returned -1
caner@vegan:~/magento-caner/dockerized-magento$ ./magento start
dockerizedmagento_fullpagecache_1 is up-to-date
dockerizedmagento_solr_1 is up-to-date
dockerizedmagento_mysql_1 is up-to-date
dockerizedmagento_sessions_1 is up-to-date
dockerizedmagento_cache_1 is up-to-date
dockerizedmagento_php_1 is up-to-date
Starting dockerizedmagento_nginx_1

ERROR: for nginx driver failed programming external connectivity on endpoint dockerizedmagento_nginx_1 (3e4887cb50ff899b19f660d3886f03d6682cf6332373912c0aa9e3932f4d8e5c): Error starting userland proxy: listen tcp 0.0.0.0:80: listen: address already in use
Traceback (most recent call last):
File "", line 3, in
File "compose/cli/main.py", line 63, in main
AttributeError: 'ProjectError' object has no attribute 'msg'
docker-compose returned -1
caner@vegan:~/magento-caner/dockerized-magento$

after a whihle, the error is when i open the page

403 Forbidden

nginx/1.11.3

which are given from console :

installer_1 |
installer_1 | Fixing filesystem permissions
installer_1 | Installation fininished
installer_1 | Frontend: http://dockerized-magento.local/
installer_1 | Backend: http://dockerized-magento.local/admin
installer_1 | - Username: admin
installer_1 | - Password: password123

images are

fabf508632a6 dockerizedmagentomaster_installer "/bin/install.sh" 4 minutes ago Up 4 minutes dockerizedmagentomaster_installer_1
44a8db375577 nginx:latest "nginx -g 'daemon off" 4 minutes ago Up 4 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp dockerizedmagentomaster_nginx_1
73883d1ad863 dockerizedmagentomaster_php "php-fpm" 4 minutes ago Up 4 minutes 9000/tcp dockerizedmagentomaster_php_1
6c7e24a5f1b6 dockerizedmagentomaster_solr "/usr/bin/java -Xmx10" 4 minutes ago Up 4 minutes 8983/tcp dockerizedmagentomaster_solr_1
824765d3e79d mysql:5.5 "docker-entrypoint.sh" 4 minutes ago Up 4 minutes 0.0.0.0:3306->3306/tcp dockerizedmagentomaster_mysql_1
515fde576688 redis:latest "docker-entrypoint.sh" 28 minutes ago Up 4 minutes 6379/tcp dockerizedmagentomaster_sessions_1
e6a583fda276 redis:latest "docker-entrypoint.sh" 28 minutes ago Up 4 minutes 6379/tcp dockerizedmagentomaster_cache_1
e449459d1355 redis:latest "docker-entrypoint.sh" 28 minutes ago Up 4 minutes 6379/tcp dockerizedmagentomaster_fullpagecache_1

Also

[RuntimeException]
installer_1 | Magento folder could not be detected
installer_1 |

Basic installation php error

When i try to install from here https://github.com/andreaskoch/dockerized-magento

the errors are

checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h

  • docker-php-ext-install
    usage: /usr/local/bin/docker-php-ext-install [-jN] ext-name [ext-name ...]
    ie: /usr/local/bin/docker-php-ext-install gd mysqli
    /usr/local/bin/docker-php-ext-install pdo pdo_mysql
    /usr/local/bin/docker-php-ext-install -j5 gd mbstring mysqli pdo pdo_mysql shmop

if custom ./configure arguments are necessary, see docker-php-ext-configure

Possible values for ext-name:
bcmath bz2 calendar ctype curl dba dom enchant exif fileinfo filter ftp gd gettext gmp hash iconv imap interbase intl json ldap mbstring mcrypt mssql mysql mysqli oci8 odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_oci pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell readline recode reflection session shmop simplexml snmp soap sockets spl standard sybase_ct sysvmsg sysvsem sysvshm tidy tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zip
ERROR: Service 'php' failed to build: The command '/bin/sh -c buildDeps=" libpng12-dev libjpeg-dev libmcrypt-dev libxml2-dev freetype* "; set -x && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* && docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr --with-freetype-dir && docker-php-ext-install' returned a non-zero code: 1

Where is Downloadable Content Stored?

I added a new downloadble product, a pdf book. I selected the file from the host and it appeared to upload. I did not add link. I can see the product and purchase it but it responds with no link when I download it. It responds the same for other downloadable products. Though it will download samples.

My question: where does this uploaded file go? Can I download it? What would the link be.
Or could I some dual-purpose the nginx container and use it as a static file server?

For my purposes I'm just using this for experimentation, its not going to be a live system
thanks,
Tim

Fork authorization

Hey :)

I didn't find another way to contact the original author.

This repository didn't work for me, so I forked it, and I ended up changing it quite a lot.
I would like to know if it's okay for me to opensource the changes, I kept the original license available, along with the original author names.

It's right there.

Thank you!
Doodloo.

Cannot start, getting this error:

ERROR: for nginx  Cannot start service nginx: oci runtime error: container_linux.go:247: starting container process caused "process_linux.go:359: container init caused \"rootfs_linux.go:54: mounting \\\"/d/www/zaidimustalai.lt/dockerized-magento/config/nginx/nginx.conf\\\" to rootfs \\\"/mnt/sda1/var/lib/docker/aufs/mnt/78cbfc83bd466ad2b40f190912576a8a2299a57d091caf4767c61097a304d8a7\\\" at \\\"/mnt/sda1/var/lib/docker/aufs/mnt/78cbfc83bd466ad2b40f190912576a8a2299a57d091caf4767c61097a304d8a7/etc/nginx/nginx.conf\\\" caused \\\"not a directory\\\"\""
: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
ERROR: Encountered errors while bringing up the project.

My docker-compose.yml as well I'm using Windows 10 Home Edition:

installer:
  image: andreaskoch/dockerized-magento-installer
  environment:
    DOMAIN: dockerized-magento.local
    MAGENTO_ROOT: /var/www/html/web
    MYSQL_HOST: mysql
    MYSQL_DATABASE: magento
    MYSQL_USER: root
    MYSQL_PASSWORD: pw
    ADMIN_USERNAME: admin
    ADMIN_FIRSTNAME: Admin
    ADMIN_LASTNAME: Inistrator
    ADMIN_PASSWORD: password123
    ADMIN_FRONTNAME: admin
    ADMIN_EMAIL: [email protected]
    ENCRYPTIONKEY: 731aea833710535779fe8c7c49bc6c4d
  volumes_from:
    - nginx
  volumes:
    - ./config/installer/php/php.ini:/usr/local/etc/php/php.ini
    - ./config/installer/magerun/n98-magerun.yaml.tmpl:/etc/n98-magerun.yaml.tmpl
    - ./config/installer/magento/local.xml.tmpl:/etc/local.xml.tmpl
    - ./config/installer/magento/fpc.xml.tmpl:/etc/fpc.xml.tmpl
    - ./config/installer/bin/substitute-env-vars.sh:/bin/substitute-env-vars.sh
    - ./config/installer/bin/install.sh:/bin/install.sh
  links:
    - "cache:rediscache"
    - "sessions:redissession"
    - "fullpagecache:redisfullpagecache"
    - "elasticsearch:elasticsearch"
    - "mysql:mysql"
  entrypoint: /bin/install.sh

nginx:
  image: nginx:latest
  ports:
    - "80:80"
    - "443:443"
  links:
    - "php"
  volumes:
    - ./logs/nginx:/var/log/nginx
    - ./config/ssl/cert.pem:/etc/nginx/ssl/cert.pem
    - ./config/ssl/cert.key:/etc/nginx/ssl/cert.key
    - ./config/nginx/nginx.conf:/etc/nginx/nginx.conf
    - ./config/nginx/sites-enabled/default.conf:/etc/nginx/conf.d/default.conf
    - ./config/nginx/includes:/etc/nginx/includes
    - ./config/nginx/custom-locations:/etc/nginx/custom-locations
  volumes_from:
    - php
php:
  image: andreaskoch/dockerized-magento-php
  links:
    - "cache:rediscache"
    - "sessions:redissession"
    - "fullpagecache:redisfullpagecache"
    - "elasticsearch:elasticsearch"
    - "mysql:mysql"
  volumes:
    - .:/var/www/html
mysql:
  image: mariadb:latest
  ports:
    - "3306:3306"
  environment:
    MYSQL_ROOT_PASSWORD: pw
  volumes:
    - ./data/mariadb:/var/lib/mariadb
elasticsearch:
  image: docker.elastic.co/elasticsearch/elasticsearch:5.3.0
cache:
  image: redis:latest
fullpagecache:
  image: redis:latest
sessions:
  image: redis:latest
phpmyadmin:
  image: phpmyadmin/phpmyadmin
  ports:
    - "8080:80"
  links:
    - "mysql:mysql"
  environment:
    PMA_HOST: "mysql"
    PMA_PORT: 3306

Issue start Magento docker

When starting docker with either the ./magento script or with docker-compose up, it seems to fail with a bind of MySQL.

See the following output:

root@host:~/dockerized-magento# ./magento restart
Restarting dockerizedmagento_sessions_1
Restarting dockerizedmagento_cache_1
Restarting dockerizedmagento_fullpagecache_1
Restarting dockerizedmagento_mysql_1
ERROR: Cannot restart container 09be4d0e18d5f73b4bfff53a573b17378cc137cc422f083d7caa1c542b20c118: driver failed programming external connectivity on endpoint dockerizedmagento_mysql_1 (9c9a4cb308016d6c9bb5851bb14e5eff97d931971f8f25d638c2fab4c32d250e): Error starting userland proxy: listen tcp 0.0.0.0:3306: bind: address already in use
Cannot determine the name of the container.
root@host:~/dockerized-magento# docker container ls
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
f5888efd8eb7        redis:latest        "docker-entrypoint..."   4 minutes ago       Up 33 seconds       6379/tcp            dockerizedmagento_fullpagecache_1
c725df9fcc23        redis:latest        "docker-entrypoint..."   4 minutes ago       Up 33 seconds       6379/tcp            dockerizedmagento_cache_1
e8881d92676a        redis:latest        "docker-entrypoint..."   4 minutes ago       Up 33 seconds       6379/tcp            dockerizedmagento_sessions_1

Nginx error

error:
`Status: Downloaded newer image for andreaskoch/dockerized-magento-installer:latest
Creating magento19_solr_1
Creating magento19_sessions_1
Creating magento19_fullpagecache_1
Creating magento19_mysql_1
Creating magento19_cache_1
Creating magento19_phpmyadmin_1
Creating magento19_php_1
Creating magento19_nginx_1

ERROR: for nginx Cannot start service nginx: driver failed programming external connectivity on endpoint magento19_nginx_1 (5d366ce0f8ac8c62aca58ebef0f1227d2e8a19c479d73a72e8939eb6d17c53a0): Error starting userland proxy: Bind for 0.0.0.0:80: unexpected error (Failure EADDRINUSE)
ERROR: Encountered errors while bringing up the project.`

Any idea what's causing this?

503 Error - Admin Panel

I was using dockerized-magento normally, without any problem, but yesterday I updated my local repo, running git pull. So I performed ./magento destroy in order to destroy all the containers, and after, I performed ./magento start and docker-compose up again.

From there, the following error started to happens every time I login to admin panel:

a:5:{i:0;s:698:"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'sales_bestsellers_aggregated_yearly.product_type_id' in 'field list', query was: SELECT COUNT(*) FROM (SELECT MAX(DATE_FORMAT(period, '%Y-%m-%d')) AS `period`, SUM(qty_ordered) AS `qty_ordered`, `sales_bestsellers_aggregated_yearly`.`product_id`, MAX(product_name) AS `product_name`, MAX(product_price) AS `product_price`, `sales_bestsellers_aggregated_yearly`.`product_type_id` FROM `sales_bestsellers_aggregated_yearly` WHERE (EXISTS (SELECT 1 FROM `catalog_product_entity` AS `existed_products` WHERE (sales_bestsellers_aggregated_yearly.product_id = existed_products.entity_id))) AND (store_id IN(0)) GROUP BY `product_id` LIMIT 5) AS `t`";i:1;s:4693:"#0 /var/www/html/web/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)

Does anyone having the same trouble? 😕

REST Api not working

Magento's rest api will not work with this image since oauth is not installed.

help for magento docker setup

when i enter the setup page at url: http://127.0.0.1/index.php/install/wizard/config/

whatever i typed for mysql connection at following fields:

  • Host
  • Database Name
  • User Name
  • User Password

it always alert me Database connection error., at hint?

following is my docker status for reference:

➜  dockerized-magento git:(master) ./magento status
              Name                             Command                State             Ports          
------------------------------------------------------------------------------------------------------
dockerizedmagento_cache_1           /entrypoint.sh redis-server      Up         6379/tcp               
dockerizedmagento_fullpagecache_1   /entrypoint.sh redis-server      Up         6379/tcp               
dockerizedmagento_mysql_1           /entrypoint.sh mysqld            Up         0.0.0.0:3306->3306/tcp 
dockerizedmagento_nginx_1           entrypoint.sh nginx              Exit 128                          
dockerizedmagento_php_1             php-fpm                          Up         9000/tcp               
dockerizedmagento_sessions_1        /entrypoint.sh redis-server      Up         6379/tcp               
dockerizedmagento_solr_1            /usr/bin/java -Xmx1024m -D ...   Up         8983/tcp  

i also can telnet success with 3306 port

403 Fobidden

Hello,
I just set up your docker-compose.yml but when I try to access to Magento the browser show the 403 Forbidden message of ngnx. In the error.log there are the following errors:

[error] 7#7: *3 directory index of "/var/www/html/web/" is forbidden, client: 172.17.0.1, server: , request: "GET / HTTP/1.1", host: "dockerized-magento.local"
[error] 7#7: *3 open() "/var/www/html/web/favicon.ico" failed (2: No such file or directory), client: 172.17.0.1, server: , request: "GET /favicon.ico HTTP/1.1", host: "dockerized-magento.local", referrer: "http://dockerized-magento.local/"

Any idea?
Thank you
Marco

Copying root files into local machine

Hey @andreaskoch -

Firstly thanks for your brilliant contribution! I would like to know if there is a way to copy the root installed files, i.e. The Magento source code into my local machine and use that as a mount point?

So I would be able to modify the install as well as try out new extensions. Any help would be greatly appreciated.

Thanks.

Composer

"./magento composer update" does not work, since composer is looking in the root directory of Magento for the .json file. Would it work to remove the "/web/" from the hard-coded directory in the magento wrapper script? Other ideas?

EDIT - Removing the hard-coded "/web/" from the magento script worked :)

After installation Admin area unacessible

I did everything what is said in README.md to get docekrized-magent.local running.
I run Debian 9 (Stretch) and every step of Docker install went smooth.
When ./magent start was done i visited http://dockerized-magento.local/admin and entered admin/password123 credentials.
This is what was displayed on the screen, please help to get solution:
screenshot_20170514_021144

Should I run it with sudo? Like sudo ./magento start? I managed to add my regular user to docker group...

chgrp: changing group of '...': Input/output error

Followed the directions for installation on Mac, with NFS

it appears to be working, I can hit the URL and the frontend will load, but I am seeing this in the terminal for lots of directories.. any ideas what it could be?

chgrp: changing group of '/var/www/html/web/skin/frontend/base/default/css/solarium': Input/output error

failed to load external entity "http://dockerized-magento.local/api.php?type=v2_soap&wsdl=1"

Hello,

nice Docker, easy to install, but the SOAP API fails at http://dockerized-magento.local/api/v2_soap/index

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>WSDL</faultcode>
<faultstring>SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://dockerized-magento.local/api.php?type=v2_soap&wsdl=1' : failed to load external entity "http://dockerized-magento.local/api.php?type=v2_soap&wsdl=1" </faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

it seem's that de image could not resolve dockerized-magento.local (the WSDL refer to the server itself)

I've tried to enter php to add 127.0.0.1 in /etc/hosts but it doesn't fix the problem.

any idea ?

Can't disable all cache ./magento restart

I'm trying to use dockerized-magento for my development environment, but I have problems with the various caches.
I tried to reset everything using the command ./magento restart, is there any cache that I have to disable by hand?

403 Forever..

Or 500(/index.php/), whatever the page is, cannot load the website from another computer.

I set this up on my cloud server, and accessing the website from my local computer.

Admin Panel > System>MagentoConnect > Magento Connect Manager > 403

Magento Connect Manager throws 403 Forbidden

How do I get past this 403?

logs/access.log
172.17.0.1 - - [04/Nov/2016:07:28:37 +0000] "GET /index.php/admin/extension_local/index/key/8c1406415afa6475579d2a7c2b4f9c19/ HTTP/1.1" 302 5 "http://dockerized-magento.local/index.php/admin/dashboard/index/key/541772674d54782a3ea990343e5ce075/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-" 172.17.0.1 - - [04/Nov/2016:07:28:37 +0000] "GET /downloader/?return=http%3A%2F%2Fdockerized-magento.local%2Findex.php%2Fadmin%2F HTTP/1.1" 403 169 "http://dockerized-magento.local/index.php/admin/dashboard/index/key/541772674d54782a3ea990343e5ce075/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0" "-"

logs/error.log
2016/11/04 07:28:37 [error] 7#7: *12 access forbidden by rule, client: 172.17.0.1, server: , request: "GET /downloader/?return=http%3A%2F%2Fdockerized-magento.local%2Findex.php%2Fadmin%2F HTTP/1.1", host: "dockerized-magento.local", referrer: "http://dockerized-magento.local/index.php/admin/dashboard/index/key/541772674d54782a3ea990343e5ce075/"

Install without Sample Data?

Anyone know which lines to remove/include from the installer shell script to still automate the installation but start with a fresh clean database (instead of sample data?)

installer problem at composer magento/core ?

Preparing the Magerun Configuration
Installing Magento
Composer could not detect the root package (andreaskoch/dockerized-magento) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Root composer.json requires magento/core, it could not be found in any version, there may be a typo in the package name.

Potential causes:

Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

upgrade Magento 2

Hi Andreas,

is possible upgrade configuration for magento 2?

Thanks

Magento Enterprise 1.14

I am so close! I figured out how to configure the comnposer.json file (below) to grab my repo, but composer is installing it into the vendor directory instead of the web directory. I assume the "extra" section of the composer.json file worked with the magento/core repo but it isn't working with mine. Any ideas?

{
"name": "",
"description": "",
"license": "BSD-3-Clause",
"homepage": "",
"require": {
"aoepeople/aoe_scheduler": "v0.4.3",
"aschroder/smtp_pro": "v2.0.5",
"gordonlesti/lesti_fpc": "1.3.6",
"jeroenvermeulen/solarium": "v1.6.9-beta",
"magento-hackathon/magento-composer-installer": "v2.1.1",
"brandontamm/magento-core": "1.14"
},
"require-dev": {
"aoepeople/aoe_profiler": "v0.3.0",
"aoepeople/aoe_templatehints": "v0.4.1",
"avstudnitz/scopehint": "dev-master#9fd3eb0978fa67b55f5756494569746119f3f2f6",
"tim-reynolds/magento-qconfig": "1.0"
},
"repositories": [
{
"type": "composer",
"url": "http://packages.firegento.com"
},
{
"type":"package",
"package": {
"name": "brandontamm/magento-core",
"version":"1.14",
"source": {
"url": "https://github.com/brandontamm/magento-core.git",
"type": "git",
"reference":"1.14"
}
}
}

],
"extra": {
"magento-root-dir": "web",
"auto-append-gitignore": true
},
"config": {
"discard-changes": true
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-install-cmd": [
],
"post-update-cmd": [
]
}
}

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.