Sign inSign up

busybox42/nginx_php-docker-centos

By busybox42

Updated about 7 years ago

This is a nginx/php-fpm server running on CentOS 7.

Image
1

10K+

busybox42/nginx_php-docker-centos repository overview

nginx_php-docker-centos

This repository contains a docker image of CentOS 7 with Nginx, php-fpm and certbot-nginx for ssl if needed.

Downloading the image

The first step is to pull the image.

docker pull busybox42/nginx_php-docker-centos

Creating the container

Now that we have the image busybox42/nginx_php-docker-centos we can create the container with a few parameters.

Name the container, expose ports 80 and 443 for a webserver and set a hostname.

docker run --name nginx -p 80:80 -p 443:443 -h web.myhost.tld busybox42/nginx_php-docker-centos

Here is an example of storing the nginx and html configuration on the docker host.

docker run --name nginx -p 80:80 -p 443:443 -h web.myhost.tld -v /srv/web/nginx:/etc/nginx -v /srv/web/http:/srv/http busybox42/nginx_php-docker-centos

Configuring your server

Nginx configuartion files are located in /etc/nginx. Store you web files in /srv/http.

Use certbot to create an ssl certificate for your site.

certbot --nginx -d myhost.tld -d www.myhost.tld

Tag summary

Content type

Image

Digest

Size

172.7 MB

Last updated

about 7 years ago

docker pull busybox42/nginx_php-docker-centos