|
-
-**[Apache 2.2](https://github.com/devilbox/docker-apache-2.2) | [Apache 2.4](https://github.com/devilbox/docker-apache-2.4) | [Nginx stable](https://github.com/devilbox/docker-nginx-stable) | Nginx mainline**
-
-----
-
-
-## Usage
-#### Automated virtual hosts
+> ##### ๐ฑ GitHub: [devilbox/docker-nginx-mainline](https://github.com/devilbox/docker-nginx-mainline)
-1. Automated virtual hosts can be enabled by providing `-e MASS_VHOST_ENABLE=1`.
-2. You should mount a local project directory into the Docker under `/shared/httpd` (`-v /local/path:/shared/httpd`).
-3. You can optionally specify a global server name suffix via e.g.: `-e MASS_VHOST_TLD=.loc`
-4. You can optionally specify a global subdirectory from which the virtual host will servve the documents via e.g.: `-e MASS_VHOST_DOCROOT=www`
-5. Allow the Docker to expose its port via `-p 80:80`.
-6. Have DNS names point to the IP address the container runs on (e.g. via `/etc/hosts`)
+| Web Server Project | Reference Implementation |
+|:-------------------:|:------------------------:|
+|
|
|
+| Streamlined Webserver images | The [Devilbox](https://github.com/cytopia/devilbox) |
-With the above described settings, whenever you create a local directory under your projects dir
-such as `/local/path/mydir`, there will be a new virtual host created by the same name
-`http://mydir`. You can also specify a global suffix for the vhost names via
-`-e MASS_VHOST_TLD=.loc`, afterwards your above created vhost would be reachable via
-`http://mydir.loc`.
-
-Just to give you a few examples:
-
-**Assumption:** `/local/path` is mounted to `/shared/httpd`
+**[Apache 2.2](https://github.com/devilbox/docker-apache-2.2) | [Apache 2.4](https://github.com/devilbox/docker-apache-2.4) | [Nginx stable](https://github.com/devilbox/docker-nginx-stable) | Nginx mainline**
-| Directory | `MASS_VHOST_DOCROOT` | `MASS_VHOST_TLD` | Serving from (*) | Via |
-|-----------|----------------------|------------------|--------------------------|----------------------|
-| work1/ | htdocs/ | | /local/path/work1/htdocs | http://work1 |
-| work1/ | www/ | | /local/path/work1/www | http://work1 |
-| work1/ | htdocs/ | .loc | /local/path/work1/htdocs | http://work1.loc |
-| work1/ | www/ | .loc | /local/path/work1/www | http://work1.loc |
+----
-(*) This refers to the directory on your host computer
-**Assumption:** `/tmp` is mounted to `/shared/httpd`
+## ๐ Available Docker tags
-| Directory | `MASS_VHOST_DOCROOT` | `MASS_VHOST_TLD` | Serving from (*) | Via |
-|-----------|----------------------|------------------|--------------------------|----------------------|
-| api/ | htdocs/ | | /tmp/api/htdocs | http://api |
-| api/ | www/ | | /tmp/api/www | http://api |
-| api/ | htdocs/ | .test.com | /tmp/api/htdocs | http://api.test.com |
-| api/ | www/ | .test.com | /tmp/api/www | http://api.test.com |
+[](https://hub.docker.com/r/devilbox/nginx-mainline)
-(*) This refers to the directory on your host computer
+[`latest`][tag_latest] [`debian`][tag_debian] [`alpine`][tag_alpine]
+```bash
+docker pull devilbox/nginx-mainline
+```
-You would start it as follows:
+[tag_latest]: https://github.com/devilbox/docker-nginx-mainline/blob/master/Dockerfiles/Dockerfile.latest
+[tag_debian]: https://github.com/devilbox/docker-nginx-mainline/blob/master/Dockerfiles/Dockerfile.debian
+[tag_alpine]: https://github.com/devilbox/docker-nginx-mainline/blob/master/Dockerfiles/Dockerfile.alpine
-```shell
-docker run -it \
- -p 80:80 \
- -e MASS_VHOST_ENABLE=1 \
- -e MASS_VHOST_DOCROOT=www \
- -e MASS_VHOST_TLD=.loc \
- -v /local/path:/shared/httpd \
- devilbox/nginx-mainline
-```
-#### Customization per virtual host
+#### Rolling releases
-Each virtual host is generated from templates by **[vhost-gen](https://github.com/devilbox/vhost-gen/tree/master/etc/templates)**. As `vhost-gen` is really flexible and allows combining multiple templates, you can copy and alter an existing template and then place it in a subdirectory of your project folder. The subdirectory is specified by `MASS_VHOST_TPL`.
+The following Docker image tags are rolling releases and are built and updated every night.
-**Assumption:** `/local/path` is mounted to `/shared/httpd`
+[](https://github.com/devilbox/docker-nginx-mainline/actions?query=workflow%3Anightly)
-| Directory | `MASS_VHOST_TPL` | Templates are then read from (*) |
-|-----------|------------------|------------------------------|
-| work1/ | cfg/ | /local/path/work1/cfg/ |
-| api/ | cfg/ | /local/path/api/cfg/ |
-| work1/ | conf/ | /local/path/work1/conf/ |
-| api/ | conf/ | /local/path/api/conf/ |
+| Docker Tag | Git Ref | Available Architectures |
+|----------------------------------|--------------|-----------------------------------------------|
+| **[`latest`][tag_latest]** | master | `amd64`, `i386`, `arm64`, `arm/v7`, `arm/v6` |
+| [`debian`][tag_debian] | master | `amd64`, `i386`, `arm64`, `arm/v7`, `arm/v6` |
+| [`alpine`][tag_alpine] | master | `amd64`, `i386`, `arm64`, `arm/v7`, `arm/v6` |
-(*) This refers to the directory on your host computer
-#### Customizing the default virtual host
+#### Point in time releases
-The default virtual host can also be overwritten with a custom template. Use `MAIN_VHOST_TPL` variable in order to set the subdirectory to look for template files.
+The following Docker image tags are built once and can be used for reproducible builds. Its version never changes so you will have to update tags in your pipelines from time to time in order to stay up-to-date.
-#### Enabling PHP-FPM
+[](https://github.com/devilbox/docker-nginx-mainline/actions?query=workflow%3Abuild)
-PHP-FPM is not included inside this Docker container, but can be enabled to contact a remote PHP-FPM server. To do so, you must enable it and at least specify the remote PHP-FPM server address (hostname or IP address). Additionally you must mount the data dir under the same path into the PHP-FPM docker container as it is mounted into the web server.
+| Docker Tag | Git Ref | Available Architectures |
+|----------------------------------|--------------|-----------------------------------------------|
+| **[`plain - only serve via httpssl - only serve via httpsboth - serve via http and httpsredir - serve via https and redirect http to httpsplain - only serve via httpssl - only serve via httpsboth - serve via http and httpsredir - serve via https and redirect http to https| Nginx | +Logging | +Features | +
|---|---|---|
+ WORKER_CONNECTIONS+ WORKER_PROCESSES+ HTTP2_ENABLE+ |
+
+ DEBUG_ENTRYPOINT+ DEBUG_RUNTIME+ DOCKER_LOGS+ |
+
+ TIMEZONE+ NEW_UID+ NEW_GID+ |
+
| Main vHost | +Mass vHost | +PHP | +
+ MAIN_VHOST_ENABLE+ MAIN_VHOST_SSL_TYPE+ MAIN_VHOST_SSL_GEN+ MAIN_VHOST_SSL_CN+ MAIN_VHOST_DOCROOT+ MAIN_VHOST_TPL+ MAIN_VHOST_STATUS_ENABLE+ MAIN_VHOST_STATUS_ALIAS+ |
+
+ MASS_VHOST_ENABLE+ MASS_VHOST_SSL_TYPE+ MASS_VHOST_SSL_GEN+ MASS_VHOST_TLD+ MASS_VHOST_DOCROOT+ MASS_VHOST_TPL+ |
+
+ PHP_FPM_ENABLE+ PHP_FPM_SERVER_ADDR+ PHP_FPM_SERVER_PORT+ PHP_FPM_TIMEOUT+ |
+
| Data dir | +Config dir | +
|---|---|
+ /var/www/default/+ /shared/httpd/+ |
+
+ /etc/httpd-custom.d/+ /etc/vhost-gen.d/+ |
+
+
|
-Each PHP-FPM docker also has the option to enable Xdebug and more, see their respective Readme files for futher settings.
+Note, for this to work, the `~/my-host-www` dir must be mounted into the Nginx container as well as into the php-fpm container.
+Each PHP-FPM container also has the option to enable Xdebug and more, see their respective Readme files for futher settings.
```bash
-# Start the PHP-FPM docker, mounting the same diectory
-$ docker run -d -p 9000 -v ~/my-host-www:/var/www/default --name php cytopia/php-fpm-5.6
+# Start the PHP-FPM container, mounting the same diectory
+docker run -d -it \
+ --name php \
+ -p 9000 \
+ -v ~/my-host-www:/var/www/default \
+ devilbox/php-fpm:5.6-prod
-# Start the Nginx Docker, linking it to the PHP-FPM docker
-$ docker run -d \
+# Start the Nginx Docker, linking it to the PHP-FPM container
+docker run -d -it \
-p 80:80 \
-v ~/my-host-www:/var/www/default \
-e PHP_FPM_ENABLE=1 \
-e PHP_FPM_SERVER_ADDR=php \
-e PHP_FPM_SERVER_PORT=9000 \
--link php \
- -t devilbox/nginx-mainline
+ devilbox/nginx-mainline
```
-#### 3. Fully functional LEMP stack
+### Fully functional LEMP stack
-Same as above, but also add a MySQL docker and link it into Nginx.
+Same as above, but also add a MySQL container and link it into Nginx.
```bash
-# Start the MySQL docker
-$ docker run -d \
+# Start the MySQL container
+docker run -d -it \
+ --name mysql \
-p 3306:3306 \
-e MYSQL_ROOT_PASSWORD=my-secret-pw \
- --name mysql \
- -t cytopia/mysql-5.5
+ devilbox/mysql:mysql-5.5
-# Start the PHP-FPM docker, mounting the same diectory.
+# Start the PHP-FPM container, mounting the same diectory.
# Also make sure to
# forward the remote MySQL port 3306 to 127.0.0.1:3306 within the
-# PHP-FPM docker in order to be able to use `127.0.0.1` for mysql
-# connections from within the php docker.
-$ docker run -d \
+# PHP-FPM container in order to be able to use `127.0.0.1` for mysql
+# connections from within the php container.
+docker run -d -it \
+ --name php \
-p 9000:9000 \
-v ~/my-host-www:/var/www/default \
-e FORWARD_PORTS_TO_LOCALHOST=3306:mysql:3306 \
- --name php \
- cytopia/php-fpm-5.6
+ devilbox/php-fpm:5.6-prod
-# Start the Nginx Docker, linking it to the PHP-FPM docker
-$ docker run -d \
+# Start the Nginx Docker, linking it to the PHP-FPM container
+docker run -d -it \
-p 80:80 \
-v ~/my-host-www:/var/www/default \
-e PHP_FPM_ENABLE=1 \
@@ -254,25 +286,121 @@ $ docker run -d \
-e PHP_FPM_SERVER_PORT=9000 \
--link php \
--link mysql \
- -t devilbox/nginx-mainline
+ devilbox/nginx-mainline
```
-#### 4. Ultimate pre-configured docker-compose setup
-
-Have a look at the **[Devilbox](https://github.com/cytopia/devilbox)** for a fully-customizable docker-compose variant.
-
-It offers pre-configured mass virtual hosts and an intranet.
-
-It allows any of the following combinations:
-* PHP 5.2, PHP 5.3, PHP 5.4, PHP 5.5, PHP 5.6, PHP 7.0, PHP 7.1, PHP 7.2, PHP 7.3, PHP 7.4 and PHP 8.0
-* MySQL 5.5, MySQL 5.6, MySQL 5.7, MariaDB 5 and MariaDB 10
-* Apache 2.2, Apache 2.4, Nginx stable and Nginx mainline
-* And more to come...
-
-
-## Version
-
-```
-nginx version: nginx/1.21.6
-```
+## ๐ค Sister Projects
+
+Show some love for the following sister projects.
+
+| ๐ค Project | +๐ฑ GitHub | +๐ DockerHub | +
|---|---|---|
![]() |
+ Devilbox |
+ + |
![]() |
+ docker-php-fpm |
+ devilbox/php-fpm |
+
![]() |
+ docker-php-fpm-community |
+ devilbox/php-fpm-community |
+
![]() |
+ docker-mysql |
+ devilbox/mysql |
+
![]() |
+
+ docker-apache-2.2+ docker-apache-2.4+ docker-nginx-stable+ docker-nginx-mainline
+ |
+
+ devilbox/apache-2.2+ devilbox/apache-2.4+ devilbox/nginx-stable+ devilbox/nginx-mainline
+ |
+
๐ Documentation |
+ ๐ฎ Discord |
+ ๐ช Forum |
+
|---|---|---|
|
+
+ |
+
+
+ |
+
+
+ |
+
| devilbox.readthedocs.io | +discord/devilbox | +devilbox.discourse.group | +
plain - only serve via httpssl - only serve via httpsboth - serve via http and httpsredir - serve via https and redirect http to httpsplain - only serve via httpssl - only serve via httpsboth - serve via http and httpsredir - serve via https and redirect http to https