This repository should make it super simple to run Opencart in docker containers.
- Firstly, create a project folder and place the OpenCart files insde there.
- Add the opencart-docker files:
-
if you are using Git already you could add it as a submodule:
$ git submodule add https://github.com/DockerIt/opencart-docker.git
-
if not, either copy the files or clone into the project directory:
$ git clone https://github.com/DockerIt/opencart-docker.git
-
It should look a bit like this:
|-- project-root | |-- opencart-docker | |-- tests | |-- upload | |-- vendor | |-- build.xml | |-- changelog.md | |-- etc...
-
Copy the .env-example to .env and make any changes to the environment variables that you want.
$ cp .env-example .env
-
Now, in the opencart-docker folder, we want run it and serve Opencart. The simplest way is:
$ docker-compose up -d apache mysql
-
Finally we need to be able to access the site. We need to put the docker ip address into the HOSTS file. This will be different on different operating systems.
-
Simple. Docker is native so open
/etc/hosts
and add127.0.0.1 opencart.test
-
Firstly, make sure the docker-machine is up and running and type the command
docker-machine ip
-
Copy this value, usually
192.168.99.100
-
Add this to your HOSTS file (usually)
C:/Windows/System32/drivers/etc/hosts
192.168.99.100 opencart.test
-
Visit http://opencart.test/ :-)
-
The OpenCart install is now really simple.
-
Create the
config.php
files in bothupload/
andupload/admin/
. -
In the database configuration use the values in
.env
. The defaults are:- hostname: mysql
- username: opencart
- password: password
- database: opencart
-
Click continue and then OpenCart should install and you should be able to access your store!