Nginx container for developers
1.8K
Development environments with nginx running in docker.
This docker setup runs nginx alpine and aims for 'minimal-config' (i.e. no custom Dockerfiles, just use docker-compose). You can configure nginx by passing environment variables.
By default, minimal-configuration examples are provided for:
Specify the config handle in the environment variable config_handle.
See the examples directory for some common configuration examples.
Run symfony 4 (mount the project dir to /var/www/html)
version: '3.7'
services:
nginx:
image: 24hoursmedia/nginx4devs:latest
environment:
config_handle: symfony4
ports:
- 8803:80
depends_on:
- php
volumes:
- ./html:/var/www/html:ro
php:
image: 24hoursmedia/pfpm73rutor:latest
volumes:
- ./html:/var/www/html:ro
You can place .conf files in /etc/nginx/app/*.conf. They will get included in in the server block by one of the default configurations
You can configure the nginx configuration to use by specifying an environment variable. The most important variable is 'config_handle', it specifies the template to use. The other environment variables depend on the template.
| name | default | description |
|---|---|---|
| document_root | /var/www/html/public | The document root for nginx |
| phpfpm_host | php | hostname for the php fpm server, usually the service name in docker-compose |
| phpfpm_port | 9000 | the port that php-fpm is running on |
| phpfpm_memory_limit | 256M | memory limit for php |
| phpfpm_max_execution_time | 120 | php execution time limit |
| name | default | description |
|---|---|---|
| document_root | /var/www/html/web | The document root for nginx |
| phpfpm_host | php | hostname for the php fpm server, usually the service name in docker-compose |
| phpfpm_port | 9000 | the port that php-fpm is running on |
| phpfpm_memory_limit | 256M | memory limit for php |
| phpfpm_max_execution_time | 120 | php execution time limit |
Content type
Image
Digest
Size
11.2 MB
Last updated
over 5 years ago
docker pull 24hoursmedia/nginx4devs