This project is based on ajardin repository
web
: PHP 7.2 version with Apache (web server).mysql
: mysql:latest image (database).maildev
: djfarrelly/maildev:latest image (emails debugging).
Since this environment is designed for a local usage, it comes with features helping the development workflow.
The web
container has a mount point used to share source files.
By default, the ~/www/
directory is mounted from the host. It's possible to change this path by editing the docker-compose.yml
file.
It's also possible to add custom virtual hosts: all ./web/vhosts/*.conf
files are copied in the Apache directory during the image build process.
And the ./web/custom.ini
file is used to customize the PHP configuration during the image build process.
This process assumes that Docker Engine and Docker Compose are installed. Otherwise, you should have a look to Install Docker Engine before proceeding further.
$ git clone git@github.com:hochgenug/docker-vns.git vns
$ cp docker-env.dist docker-env
$ nano docker-env
$ docker-compose build
$ docker-compose up -d
# or make start
$ docker-compose ps
Name Command State Ports
--------------------------------------------------------------------------------------------
docker-vns_maildev_1 bin/maildev --web 80 --smtp 25 Up 25/tcp, 0.0.0.0:1088->80/tcp
docker-vns_mysql_1 docker-entrypoint.sh mysqld Up 0.0.0.0:3306->3306/tcp
docker-vns_web_1 docker-php-entrypoint apac ... Up 0.0.0.0:80->80/tcp
Note: You will see something slightly different if you do not clone the repository in a vns
directory.
The container prefix depends on your directory name.
$ docker exec -it vns_web_1 bash
# or : make web
(To get the name use the docker-compose ps
command)
You can also use the Makefile for commands.
Syntax : make <command>
$ make help
backup Backup the "mysql" volume
build Build the environment
logs Follow logs generated by all containers
logs-full Follow logs generated by all containers from the containers creation
mysql Open a terminal in the "mysql" container
ps List all containers managed by the environment
restart Restart the environment
restore Restore the "mysql" volume
start Start the environment
stats Print real-time statistics about containers ressources usage
stop Stop the environment
web Open a terminal in the "web" container