Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oberonamsterdam/docker-apache24-fpm
https://github.com/oberonamsterdam/docker-apache24-fpm
docker dockerfile httpd
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/oberonamsterdam/docker-apache24-fpm
- Owner: oberonamsterdam
- Created: 2018-04-30T09:42:56.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-10T20:06:31.000Z (about 2 years ago)
- Last Synced: 2024-11-20T21:42:28.471Z (2 months ago)
- Topics: docker, dockerfile, httpd
- Language: Dockerfile
- Size: 6.84 KB
- Stars: 2
- Watchers: 7
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Based on https://hub.docker.com/_/httpd/
The "latest"-image is based on httpd:2.4-alpineDefault Oberon apache setup using PHP-FPM, requires a PHP-FPM docker image: official ones from PHP or the custom build one in our other repository.
Note: If you don't need PHP (like only serving plain html) then we recommend using the vanilla HTTPD container or something lightweight like nginx/lighttpd.# This image has the following modules enabled:
* mod_alias
* mod_rewrite
* mod_proxy_wstunnel
* mod_proxy_fcgi
* mod_proxy# Additional configurations:
* mod_expires - with 1 month on image/css/javascript assets additional minetypes for svg and fonts
* mod_deflate - on text assets (html, css, js, svg, xml, plain) production settings on signatures# Adding your own configurations:
Add your own configurations by adding entries to the web-container volumes under "/usr/local/apache2/conf/other/":
```
web:
volumes:
- myconfiguration.conf:/usr/local/apache2/conf/other/myconfiguration.conf
```Note that HTTPS is disabled since we use an Nginx proxy ourselves so don't forget to enable that when you need it.
# Example docker-compose.yml:
```
version: '3'
services:
web:
image: oberonamsterdam/apache24-fpm:latest
restart: always
network_mode: "bridge"
environment:
- "VIRTUAL_HOST=my.domain.ext"
- "APACHE_DOCUMENTROOT=/app/web"
links:
- php
depends_on:
- php
volumes:
- .:/app/:delegated
php:
image: oberonamsterdam/php:7.1-fpm
restart: always
network_mode: "bridge"
volumes:
- .:/app/:delegated
```Switch PHP version by using another PHP image (exposed PHP-FPM on port 9000).
# Switch PHP container hostname or portnumber
You can use the PHP_FPM_HOSTNAME and PHP_FPM_PORT environment variables to change the hostname and
port Apache uses to connect to PHP-FPM:```
version: '3'
services:
web:
...SNIP
environment:
- "VIRTUAL_HOST=my.domain.ext"
- "APACHE_DOCUMENTROOT=/app/web"
- "PHP_FPM_HOSTNAME=my_php_container"
- "PHP_FPM_PORT=9001"
```# OPENID CONNECT
The "openidc"-image is based on httpd:2.4 (since the mod_auth_openidc is not available for Alpine)
Using the openidc-tagged image, use this for example to add an initial auth to your container (instead of htpasswd).
Complete manual of openidc config can be found here: https://github.com/zmartzone/mod_auth_openidcThis an example using google and your own domain (so only people from your own company can access this container)
```
LoadModule auth_openidc_module /usr/lib/apache2/modules/mod_auth_openidc.soOIDCProviderMetadataURL https://accounts.google.com/.well-known/openid-configuration
OIDCClientID <>
OIDCClientSecret <>OIDCAuthRequestParams hd=<>
OIDCRedirectURI https://${VIRTUAL_HOST}/redirect
OIDCCryptoPassphrase <>
OIDCRemoteUserClaim email
OIDCScope "openid email"
OIDCAuthNHeader X-Forwarded-UserAuthType openid-connect
Require claim hd:<>
Require valid-user```
After this, add the config to the web-container:
```
version: '3'
services:
web:
image: oberonamsterdam/apache24-fpm:openidc
volumes:
- .:/app/:delegated
- openidc.conf:/usr/local/apache/config/other/openidc.conf```