Version 1.02. of Mocker
Edit build\custom.conf
- Change
projectAbsolutePath
to Your all projects folder. - Copy db sql dump to
./db
. Script will select the newest one from this directory. - Prepare git link to repo.
- You can enter gitRepoLink in
build\custom.conf
but You will be asked in building step anyway. - In Terminal enter
docker pull fr4gm3nt/mocker:node6
-
Run
./bin/build
and follow script instructions.Docker will prepare necessary files. If You want add additional Magento, files copy them to
./magento
folder after the build step. Otherwise they will be overwritten.During installation You will be asked to enter:
- Git repository URL - this is optional but makes all much easier. Note that when project folder is not empty git will skip downloading files.
- Project source folder - it's Your project folder like
0000-Magento
. You should change absolute path inbuild\custom.conf
- Project name - based on that variable program will create docker containers
- Project number - it's crucial. Base on that program will create ports for docker.
- PHP version - Magento 2 supports PHP 7.0 and 7.1 but You can choose any other.
- Database name - it's database name inside container. You may leave it default.
You will be asked:
Do you want to import newest database dump from db directory (e - enter filename)? [Y/n/e]
Y (default) - Program will search for newest sql file in
./db
and prepare installation file to import it. n - program will skip this step. You can import db any time inside db container e - You can enter db name of Your choose (file must be present in db folder.) format:filename.sql
- Run
./bin/install
This may take a while. Especially if You are running docker for the first time.
Each build is prepared for one project. After installation You will need at least.
./docker-compose.yml
./bin
folder.
For now there's only one helper script - ./bin/exec
. It will help you with executing commands inside of container.
Usage:
./bin/exec <container_suffix> <optional_command>
Eg.
bin/exec php "php -v"
type
./bin/exec -h
for help
Container suffixes are: php, nginx, node and db.
If you don't pass an <optional_command>, then it will call /bin/bash
by default and you'll end up inside of the container.
During building process program will copy .build/php_bashrc
to ./php
. This file contains aliases. You can use them only inside php container.
bin/exec php
.
By deafult Mailhog is running at port 6025. 6XXX where XXX are 3 last digits of Your project.
There is no need to keep all containers running. Eg. after system restart dockers will stop. To restart them enter:
bin/start
Fork of https://github.com/pgoca/magento2docker
- Changed Apache to nginx.
- docker-compose is in version 3.
- http://localhost:8080 is default address - port may be changed during installation.
- Copy database sql file to
db
folder. Installer will choose to newset one from the folder. You can also type database of Your choice. - Default path for project files is /var/www/m2/. You can change this in bin/custom.conf
projectAbsolutePath
. You can also change this path during installation. - Simplified containers names, and changed docker commands to docker-compose.
#####Version 1.02
- Simplified containers names
- Docker commands changed to docker-compose
#####Version 1.01
- short help command added - type
./bin/exec -h
for help - gulp styles --production - shortcut added
- changed docker images for php and node6
- for custom builds purposes Dockerfiles are still included
- NodeJS6 container is no longer a part of Mocker. You should pull it separatly and only once.
docker pull fr4gm3nt/mocker:node6
and run it from./bin/exec
.