Go to file
Adrien Marquès 4cf9c79112 add docker-compose.yml | setup base configuration for nginx+php-fpm |
begin readme
2018-09-26 14:07:23 +02:00
virtual add docker-compose.yml | setup base configuration for nginx+php-fpm | 2018-09-26 14:07:23 +02:00
LICENSE update licence credentials 2018-09-26 13:56:29 +02:00
README.md add docker-compose.yml | setup base configuration for nginx+php-fpm | 2018-09-26 14:07:23 +02:00
docker-compose.yml add docker-compose.yml | setup base configuration for nginx+php-fpm | 2018-09-26 14:07:23 +02:00

README.md

| Introduction to docker (2) |

[TOC]

II. Linking containers

1)

III. Setting up a development stack

1) Choosing images

We will setup a simple web dev stack with :

  • nginx (i.e. nginx:latest)
  • mariadb (i.e. mariadb:latest)
  • php-fpm (i.e. php:7-fpm)

2) Volume & network sharing policy

1. Volume sharing

a) Configuration files

The apache and php configuration will be on the host machine (for easy modification) and only mounted on the containers to override the default configuration files. A virtual folder will hold these configurations with the same path for consistency:

b) Storage files

MariaDB will have its whole data folder (i.e. /var/lib/mysql) on the host in the virtual folder to have the data remaining throughout containers. This property makes the database consistent and persistent among container creation/deletion.

c) Log files

Also logs will be mounted the same way in order for developers to easily check these out when needed (e.g. virtual/var/log/apache2/access.log). Also, note that even if the container is removed, the logs will remain.

d) Development folder

The development folder (i.e. the actual code to test) is located in the folder virtual/vhost. In a real-world use of this configuration, I would clone a git repository into it in order for my docker configuration and my actual code not to mix together ; we could then use git submodules for version stability among the 2 repositories.

2. Network sharing

The whole system will only expose its port 8080 ; we are not using the default HTTP port not to break a possible web server on the host. Containers between them will be connected through the default overlay network which is unreachable from the host.