Nginx Docker Compose | docker compose nginx index html
Maybeyouneedawebserverforasimplestaticsite.Forinstance,totestoutthe
Maybe you need a web server for a simple static site. For instance, to test out the <script type="module">. Perform a Lighthouse Audit. Or preview your HTML page through you phone.
But it can be tedious to install, configure & fire up a web server on your local machine.
Today Im going to show you how you can save some precious time & serve your static assets with this simple Docker Compose configuration.
Steps1 — Go back to your base directory
$ cd ~/ Enter fullscreen modeExit fullscreen mode2 — Create the working directory
$ mkdir docker-nginx-demo Enter fullscreen modeExit fullscreen mode3 — Go into that directory
$ cd docker-nginx-demo Enter fullscreen modeExit fullscreen mode4 — Create the Docker & Docker Compose configuration
$ touch docker-compose.yaml Enter fullscreen modeExit fullscreen mode5 — Create the directory that wi...