docker run --name <container_name> -v /your/content/directory:/var/www/html:cached -d ahregueiro/nginx
Alternatively, a simple Dockerfile can be used to generate a new image that includes the necessary content (which is a much cleaner solution than the bind mount above):
FROM ahregueiro/nginx
COPY /your/content/directory /var/www/html
Then, build the new image and start (run) your container.
Or, alternatively, you can use it in a docker-compose.yml file:
services:
project_nginx:
image: ahregueiro/nginx:1.25
container_name: "project_server"
volumes:
- your/content/directory:/var/www/html:cached
You can add a new volume to your docker-compose.yml like this:
- ./<projectname>/nginx/default_php82.conf:/etc/nginx/conf.d/default.conf
Or mapping it at run time:
docker run --name <container_name> -v ./<projectname>/nginx/default_php82.conf:/etc/nginx/conf.d/default.conf -d ahregueiro/nginx
You need to redefine the following environment variable to match your PHP container name and the port it's exposed on. So, add this to your docker-compose.yml file, on the project_nginx service section, making the necessary replacements:
environment:
- FCGI_HANDLER=project_php82:9000
Content type
Image
Digest
sha256:7aa2cc310…
Size
64.5 MB
Last updated
about 2 years ago
docker pull ahregueiro/nginx:1.25