List available docker images:

	docker search nginx

Download official image:

	docker pull nginx

Create persistent directory:

	mkdir -p /app/persistent_docker/nginx
	cd /app/persistent_docker/nginx
	mkdir www conf logs

Create `/app/persistent_docker/nginx/conf/nginx.conf`:

	events {

	}
	error_log         /wwwlogs/error.log info;
	http {

	  server {
	    listen       80;
	    server_name  localhost;
	    access_log    /wwwlogs/access.log  combined;
	    location / {
	        root   /www/demo;
	        index  index.html index.htm;
	    }
	  }


Create then root directory for default site:

	mkdir /app/persistent_docker/nginx/www/demo
	echo "Hello world" > /app/persistent_docker/nginx/www/demo/index.html

Start the container:
	
	docker run -p 80:80 -p 443:443 --name nginx -v /etc/letsencrypt:/etc/letsencrypt -v /app/persistent_docker/nginx/www:/www -v /app/persistent_docker/nginx/conf:/etc/nginx -v /app/persistent_docker/nginx/logs:/wwwlogs -d nginx  


In order to use docker-compose, create `docker-compose.yml`:

	services:
	  nginx:
	    image: nginx
	    restart: always
	    volumes:
	     - /etc/letsencrypt:/etc/letsencrypt
	     - /app/persistent_docker/nginx/www:/www
	     - /app/persistent_docker/nginx/conf:/etc/nginx
	     - /app/persistent_docker/nginx/logs:/wwwlogs
	    ports:
	     - 80:80
	     - 443:443


Start the container and set the autostart:

	docker-compose up -d
	docker update --restart unless-stopped nginx



