All Projects → andreaskoch → Dockerized Magento

andreaskoch / Dockerized Magento

Licence: bsd-3-clause
A dockerized Magento Community Edition 1.9.x

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Dockerized Magento

snk.dev-assistant
Assistant for code development with advanced machine learning features
Stars: ✭ 14 (-94.96%)
Mutual labels:  docker-compose
SENT-template
Skip setup and start code with SENT (Sapper Express Node Template) and other tools
Stars: ✭ 69 (-75.18%)
Mutual labels:  docker-compose
Bgp Dashboard
BGP Dashboard and Monitoring Web Application
Stars: ✭ 268 (-3.6%)
Mutual labels:  docker-compose
action
A GitHub Action that deploys live environments for your pull requests and branches
Stars: ✭ 63 (-77.34%)
Mutual labels:  docker-compose
focalboard-docker
Cross platform Docker images for Focalboard.
Stars: ✭ 12 (-95.68%)
Mutual labels:  docker-compose
docker-compose-maven-plugin
Run docker-compose with Maven
Stars: ✭ 68 (-75.54%)
Mutual labels:  docker-compose
kafka-spark-streaming-zeppelin-docker
One click deploy docker-compose with Kafka, Spark Streaming, Zeppelin UI and Monitoring (Grafana + Kafka Manager)
Stars: ✭ 82 (-70.5%)
Mutual labels:  docker-compose
Streamingphish
Python-based utility that uses supervised machine learning to detect phishing domains from the Certificate Transparency log network.
Stars: ✭ 271 (-2.52%)
Mutual labels:  docker-compose
traefik-letsencrypt-compose
Basic Traefik configuration which includes automatic Let’s Encrypt certificate management and password protected dashboard
Stars: ✭ 38 (-86.33%)
Mutual labels:  docker-compose
Docker Fail2ban
Fail2ban Docker image based on Alpine Linux
Stars: ✭ 263 (-5.4%)
Mutual labels:  docker-compose
devops-essentials
DevOps Essentials | terraform | kubernetes | linux | nginx | monitoring | docker | docker-compose
Stars: ✭ 159 (-42.81%)
Mutual labels:  docker-compose
docker-haproxy-certbot
Dockerized HAProxy with Let's Encrypt certificates automatic renewal
Stars: ✭ 28 (-89.93%)
Mutual labels:  docker-compose
The Docker Handbook
Open-source book on Docker
Stars: ✭ 257 (-7.55%)
Mutual labels:  docker-compose
react-hooks-uikit-express-oauth-boiler-v2
A React/TypeScript fullstack boilerplate utilizing React hooks, using Express as backend, UIKit for frontend, MongoDB for storage & open-authenticator for OAuth.
Stars: ✭ 110 (-60.43%)
Mutual labels:  docker-compose
Jenkins Bootstrap Shared
Jenkins as immutable infrastructure made easy. A repository of shared scripts meant to be used as a git submodule. Packing Jenkins, plugins, and scripts into immutable packages and images.
Stars: ✭ 270 (-2.88%)
Mutual labels:  docker-compose
dockerized
🐳 Build once, run anywhere
Stars: ✭ 70 (-74.82%)
Mutual labels:  docker-compose
docker-hackmd
DEPRECATION: Please read our online documentation instead
Stars: ✭ 272 (-2.16%)
Mutual labels:  docker-compose
Docker Lamp
Docker with Apache, MySql, PhpMyAdmin and Php
Stars: ✭ 276 (-0.72%)
Mutual labels:  docker-compose
Home Cloud
The "cloud" at home
Stars: ✭ 269 (-3.24%)
Mutual labels:  docker-compose
Docker Spark Cluster
A simple spark standalone cluster for your testing environment purposses
Stars: ✭ 261 (-6.12%)
Mutual labels:  docker-compose

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>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].