You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adapt domain name and SSL certs for Mac OS and Windows setups
Made some small adapaptions so the project does work when using
docker-machine.
- Use a local default snakeoil ssl cert: Not all systems have their
snakeoil certs at /etc/ssl/certs/ssl-cert-snakeoil.pem
- Changed the domain name from "127.0.0.1" to "dockerized-magento.local" in
order to allow using the project with docker-machine on Mac OS and
Windows
- Removed the Vagrant file because docker-machine makes this obsolete
- Add instructions for setting a hosts file entry (for Linux, Mac OS
and Windows).
- Add instructions for using docker-machine-nfs for better performance
on Mac OS
- Use more standard images to speed up the build
- Add local volumes for logs and data
- Update README section with stats action
Copy file name to clipboardExpand all lines: README.md
+64-37
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,59 @@ A dockerized version of "Magento Community Edition 1.9.x"
4
4
5
5
## Requirements
6
6
7
-
Before you start you should install
7
+
If you are on Linux you should install
8
8
9
9
-[docker](http://docs.docker.com/compose/install/#install-docker) and
10
10
-[docker-compose (formerly known as fig)](http://docs.docker.com/compose/install/#install-compose)
11
11
12
-
or
12
+
If you are running on [Mac OS](https://docs.docker.com/engine/installation/mac/) or [Windows](https://docs.docker.com/engine/installation/windows/) you can install the [Docker Toolbox](https://docs.docker.com/engine/installation/mac/) which contains docker, docker-compose and docker-machine.
13
13
14
-
You can use [vagrant](Vagrantfile) if you are on Windows or a Mac
14
+
## Preparations
15
+
16
+
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`.
17
+
18
+
### For Linux Users
19
+
20
+
In order to access the shop you must add the domain name "dockerized-magento.local" to your hosts file (`/etc/hosts`).
21
+
If you are using docker **natively** you can use this command:
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](https://github.com/adlogix/docker-machine-nfs)
44
+
45
+
```bash
46
+
docker-machine create --driver virtualbox nfsbox
47
+
docker-machine-nfs nfsbox
48
+
```
49
+
50
+
And to fix issues with filesystem permissions you can modify your NFS exports configuration:
51
+
52
+
1. open `/etc/exports` and replace `-mapall=$uid:$gid` with `-maproot=0`
53
+
2.`sudo nfsd restart`
54
+
55
+
Thanks to [René Penner](https://github.com/renepenner/magento-docker-boilerplate) for figuring that out.
56
+
57
+
### For Windows Users
58
+
59
+
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.
15
60
16
61
## Installation
17
62
@@ -20,7 +65,7 @@ You can use [vagrant](Vagrantfile) if you are on Windows or a Mac
20
65
3. Start the projects using `./magento start` or `docker-compose up`
[](https://s3.amazonaws.com/andreaskoch/dockerized-magento/installation/Dockerized-Magento-Installation-Linux-no-sound.mp4)
93
+
[](https://s3.amazonaws.com/andreaskoch/dockerized-magento.local/installation/Dockerized-Magento-Installation-Linux-no-sound.mp4)
49
94
50
-
**Note**: The build process and the installation process will take a while if you start the project for the first time. After thats finished starting and stoping the project will be a matter of seconds.
95
+
**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.
51
96
52
97
## Usage
53
98
@@ -63,12 +108,13 @@ You can control the project using the built-in `magento`-script which is basical
63
108
-**stop**: Stops all docker containers
64
109
-**restart**: Restarts all docker containers and flushes the cache
65
110
-**status**: Prints the status of all docker containers
111
+
-**stats**: Displays live resource usage statistics of all containers
66
112
-**magerun**: Executes magerun in the magento root directory
67
113
-**composer**: Executes composer in the magento root directory
68
114
-**enter**: Enters the bash of a given container type (e.g. php, mysql, ...)
69
115
-**destroy**: Stops all containers and removes all data
70
116
71
-
**Note**: The `magento`-script is just a small wrapper arround`docker-compose`. You can just use [docker-compose](https://docs.docker.com/compose/) directly.
117
+
**Note**: The `magento`-script is just a small wrapper around`docker-compose`. You can just use [docker-compose](https://docs.docker.com/compose/) directly.
72
118
73
119
## Components
74
120
@@ -89,7 +135,7 @@ The dockerized Magento project consists of the following components:
89
135
90
136
The component-diagram should give you a general idea* how all components of the "dockerized Magento" project are connected:
`*` 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](docker-compose.yml)
95
141
@@ -109,37 +155,18 @@ If you have started the shop before you must **repeat the installation process**
109
155
110
156
### Changing the domain name
111
157
112
-
I set the default domain name to `127.0.0.1` so you can access the shop without modifying your hosts-file. But you can simply change that by replacing `127.0.0.1` with `your-domain.tld`.
113
-
114
-
The domain name used as the **base url** for the Magento installation is referenced three times in the docker-compose.yml:
158
+
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:
115
159
116
160
```yaml
117
161
installer:
118
162
environment:
119
-
DOMAIN: 127.0.0.1
120
-
nginx:
121
-
domainname: 127.0.0.1
122
-
environment:
123
-
DOMAIN: 127.0.0.1
163
+
DOMAIN: dockerized-magento.local
124
164
```
125
165
126
-
1. In the `DOMAIN` environment variable for the **installer**
127
-
2. In `domainname` attribute of the **nginx** container
128
-
3. In the `DOMAIN` environment variable for the **nginx** container
129
-
130
-
### Using a different SSL certiticate
131
-
132
-
By default I chose the snakeoil dummy certificate that is installed on Ubuntu systems. If you are on a different system or want to use a real SSL certificate for your shop you can change the environment variables of the **nginx** container:
166
+
### Using a different SSL certificate
133
167
134
-
- `SSL_CERTIFICATE_PATH`for the path to *.pem or *.crt file
135
-
- `SSL_CERTIFICATE_KEY_PATH`for the path to the *.key file
By default I chose a dummy certificate ([config/ssl/cert.pem](config/ssl/cert.pem)).
169
+
If you want to use a different certificate you can just override the key and cert with your own certificates.
143
170
144
171
### Adapt Magento Installation Parameters
145
172
@@ -150,7 +177,7 @@ If you want to install Magento using your own admin-user or change the password,
150
177
- `ADMIN_LASTNAME`: The last name of the admin user
151
178
- `ADMIN_PASSWORD`: The password for the admin user
152
179
- `ADMIN_EMAIL`: The email address of the admin user (**Note**: Make sure it has a valid syntax. Otherwise Magento will not install.)
153
-
- `ADMIN_FRONTNAME`: The name of the backend route (e.g. `http://127.0.0.1/admin`)
180
+
- `ADMIN_FRONTNAME`: The name of the backend route (e.g. `http://dockerized-magento.local/admin`)
154
181
155
182
```yaml
156
183
installer:
@@ -166,7 +193,7 @@ installer:
166
193
167
194
### Change the MySQL Root User Password
168
195
169
-
I chose a very weak passwords for the MySQL root-user. You can change it by modifiying the respective environment variables for the **mysql-container** ... and **installer** because otherwise the installation will fail:
196
+
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:
0 commit comments