Static site with Docker and Nginx

August 18, 2019

If you need a quick way to serve static files, Nginx with Docker Compose is a hassle free alternative:

# docker-compose.yml
nginx:
  image: nginx
  volumes:
   - ./public:/usr/share/nginx/html
  ports:
   - "80:80"

Just need to create a public folder as a sibling to the docker-compose.yml and create the index.html there.