I will setup a very simple html page with docker and nginx.
Source files can be found here:
https://github.com/ikknd/docker-study in folder recipe-01
/var/www/docker-study.loc/recipe-01
-> /docker
-> /html
In "html" folder I will create index.html file, that simply says: "I work inside docker!"
In "docker" folder I will keep docker related files and configs.
127.0.0.1 myapp.loc
Here I do several things:
Note that we can point not only directories from host machines to inside of container, but also individual files.
docker-compose up -d
If I now try myapp.loc/ in browser, I will see: "I work inside docker!".
In several simple steps, I got html file to be served via nginx, and got local domain name to work with docker setup.