A simple example to show how to serve static files from docker using nginx
To run this example,
Clone this repo
- git clone https://github.com/arunkumars08/docker-static-files-serve.git
- Navigate into the directory
- You can see web folder that has static assets to be served from inside docker container.
- You see Dockerfile and nginx.conf files
Run this command
docker build -t some-name .
Once the build is complete and the image is created, run the docker
docker run -p 5000:90 some-name
Navigate to http://localhost:5000 to see the changes
For detailed reference, visit this link https://www.linkedin.com/pulse/serve-static-files-from-docker-via-nginx-basic-example-arun-kumar