Docker compose for nginx static web server

Nginx (pronounced “engine-x”) is an open source reverse proxy server for HTTP, HTTPS, SMTP, POP3, and IMAP protocols, as well as a load balancer, HTTP cache, and a web server (origin server). The nginx project started with a strong focus on high concurrency, high performance and low memory usage.

You can use my docker-compose file or check at https://hub.docker.com/_/nginx. Before deploying grab nginx.conf file with nginx settings.

docker-compose.yml file:

version: '3'

services:
  server:
    container_name: nginx-static-webserver
    image: nginx
    restart: always
    ports:
      - 9085:80
    volumes:
      - ./data:/srv
      - ./nginx.conf:/etc/nginx/conf.d/default.conf


nginx.conf file:

server{
        listen 80;
        server_name _;

        location / {
                root /srv;
                # Activate the next line if you want to list files
                # autoindex on;
        }
}


Source: https://hub.docker.com/_/nginx, https://github.com/gregorgodler/nginx-static-webserver