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/kkashyap1707/dockerStaticJSONFile.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