You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+152-121
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,15 @@
17
17
18
18
This image is based on the official **[Apache 2.2](https://hub.docker.com/_/httpd)** Docker image and extends it with the ability to have **virtual hosts created automatically**, as well as **adding SSL certificates** when creating new directories. For that to work, it integrates two tools that will take care about the whole process: **[watcherd](https://github.com/devilbox/watcherd)** and **[vhost-gen](https://github.com/devilbox/vhost-gen)**.
19
19
20
-
From a users perspective, you mount your local project directory into the container under `/shared/httpd`. Any directory then created in your local project directory wil spawn a new virtual host by the same name. Additional settings such as custom server names, PHP-FPM or even different Apache templates per project are supported as well.
20
+
From a users perspective, you mount your local project directory into the container under `/shared/httpd`. Any directory then created in your local project directory wil spawn a new virtual host by the same name. Each virtual host optionally supports a generic or custom backend configuration (**static files**, **PHP-FPM** or **reverse proxy**).
21
+
22
+
**HTTP/2 is enabled by default for all SSL connections.**
23
+
24
+
For convenience the entrypoint script during `docker run` provides a pretty decent **validation and documentation** about wrong user input and suggests steps to fix it.
@@ -75,103 +83,111 @@ The following Docker image tags are built once and can be used for reproducible
75
83
> ⚠ **Warning:** The latest available git tag is also build every night and considered a rolling tag.
76
84
77
85
78
-
## ✰ Features
79
-
80
-
> 🛈 For details see **[Documentation: Features](doc/features.md)**
81
-
82
-
### Automated virtual hosts
83
-
84
-
Virtual hosts are created automatically, simply by creating a new project directory (inside or outside of the container). This allows you to quickly create new projects and work on them in your IDE without the hassle of configuring the web server.
85
86
86
-
### Automated PHP-FPM setup
87
+
##✰ Features
87
88
88
-
PHP is not included in the provided images, but you can link the Docker container to a PHP-FPM image with any PHP version. This allows you to easily switch PHP versions and choose one which is currently required.
89
+
This repository uses official httpd Docker images and adds a lot of features, logic and autmomation op top. This allows you to feature-toggle certain functionality simply by setting environment variables.
89
90
90
-
### Automated SSL certificate generation
91
+
Below is a brief overview about most outstanding features, but I would still advice you to read up on available [environment variables](#-environment-variables), as well as the [architecture](#-architecture) to get the whole picture.
91
92
92
-
SSL certificates are generated automatically for each virtual host to allow you to develop over HTTP and HTTPS.
93
93
94
-
### Automatically trusted HTTPS
94
+
> 🛈 For details see **[Documentation: Features](doc/features.md)**
95
95
96
-
SSL certificates are signed by a certificate authority (which is also being generated). The CA file can be mounted locally and imported into your browser, which allows you to automatically treat all generated virtual host certificates as trusted.
96
+
#### Automated mass virtual hosts
97
+
* Virtual hosts are created automatically, simply by creating a new project directory (inside or outside of the container). This allows you to quickly create new projects and work on them in your IDE without the hassle of configuring the web server.
97
98
98
-
### Customization per virtual host
99
+
#### Automated PHP-FPM setup
100
+
* PHP is not included in the provided images, but you can enable a remote backend and link it to a PHP-FPM image. This allows you to easily switch PHP versions and choose one which is currently required.
99
101
100
-
Each virtual host can individually be fully customized via `vhost-gen` templates.
102
+
#### Automated Reverse Proxy setup
103
+
* In reverse proxy mode, you can choose any http or https backend of your likings. This way you can proxy NodeJS, Python, etc. and use the webserver to add SSL in front.
101
104
102
-
### Customization for the default virtual host
105
+
#### Automated SSL certificate generation
106
+
* SSL certificates are generated automatically for each virtual host if you choose to enable it
103
107
104
-
The default virtual host is also treated differently from the auto-generated mass virtual hosts. You can choose to disable it or use it for a generic overview page for all of your created projects.
108
+
#### Trusted HTTPS in all vhosts
109
+
* Virtual host SSL certificates are signed by an internal Certificate Authority (or one you provide to the image). That makes it possible to set the CA to trusted and all generated vhosts will automatically have trusted SSL.
105
110
106
-
### Reverse Proxy integration
111
+
#### Customization per virtual host
112
+
* Each virtual host can individually be fully customized via [`vhost-gen`](https://github.com/devilbox/vhost-gen) templates.
107
113
108
-
Through virtual host customization, any project can also be served with a reverse proxy. This is useful if you want to run NodeJS or Python projects which require a reverse proxy and still want to benefit with a custom domain and auto-generated SSL certificates.
114
+
#### Local file system permission sync
115
+
* File system permission/ownership of files/dirs inside the running container can be synced with the permission on your host system. This is accomplished by specifying a user- and group-id to the `docker run` command.
109
116
110
-
### Local file system permission sync
117
+
#### Tested with common Frameworks
118
+
* Wordpress, Drupal, Laravel, CakePHP, PhalconPHP, Magento, Shopware, Typo3, Yii, Zend and many others.
111
119
112
-
File system permissions of files/dirs inside the running Docker container are synced with the permission on your host system. This is accomplished by specifying a user- and group-id to the `docker run` command.
113
120
114
121
115
122
## ∑ Environment Variables
116
123
117
124
The provided Docker images add a lot of injectables in order to customize it to your needs. See the table below for a brief overview.
118
125
119
126
> 🛈 For details see **[Documentation: Environment variables](doc/environment-variables.md)**
127
+
>
128
+
> If you don't feel like reading the documentation, simply try out your `docker run` command and add
129
+
> any environment variables specified below. The validation will tell you what you might have done wrong,
The provided Docker images offer the following internal paths to be mounted to your local file system.
@@ -187,6 +203,7 @@ The provided Docker images offer the following internal paths to be mounted to y
187
203
<td>
188
204
<code>/var/www/default/</code><br/>
189
205
<code>/shared/httpd/</code><br/>
206
+
<code>/ca/</code><br/>
190
207
</td>
191
208
<td>
192
209
<code>/etc/httpd-custom.d/</code><br/>
@@ -197,94 +214,100 @@ The provided Docker images offer the following internal paths to be mounted to y
197
214
</table>
198
215
199
216
217
+
200
218
## 🖧 Exposed Ports
201
219
202
-
When you plan on using `443` you should enable automated SSL certificate generation.
220
+
When you plan on using `443` you must enable SSL via environment variables, otherwise nothing will be listening on that port.
203
221
204
222
| Docker | Description |
205
223
|--------|-------------|
206
224
| 80 | HTTP listening Port |
207
225
| 443 | HTTPS listening Port |
208
226
209
227
228
+
210
229
## 💡 Examples
211
230
212
-
### Serve static files
231
+
The documentation provides many copy/paste examples about common use-cases including dummy projects.
213
232
214
-
Mount your local directort `~/my-host-www` into the container and server those files.
233
+
The given examples distinguish between two different kinds of setup: The default vhost, which only allows to serve a single project and the mass vhost setup, which allows unlimited vhosts that are created automtically. Both types offer the same set of features and are configured in a similar way, so If you find an example in one kind it is easily applyable to the other kind as well.
215
234
216
-
**Note:** Files will be server from `~/my-host-www/htdocs`.
217
-
```bash
218
-
docker run -d -it \
219
-
-p 80:80 \
220
-
-v ~/my-host-www:/var/www/default \
221
-
devilbox/apache-2.2
222
-
```
235
+
> 🛈 For details see **[Documentation: Examples](doc/examples.md)**<br/>
236
+
> 🛈 For details see **[Docker Compose: Examples](examples/)**
<td><atitle="Bind DNS Server"href="https://github.com/cytopia/docker-bind" ><imgwidth="256px"src="https://raw.githubusercontent.com/devilbox/artwork/master/submissions_banner/cytopia/06/png/banner_256_trans.png" /></a></td>
0 commit comments