Dockerize static html with nginx

0. Folder structure

Folder name nginx_static

nginx_static   
  |
   -- Dockerfile
  |
   -- index.html

I. Dockerfile

FROM nginx:latest
COPY . /usr/share/nginx/html

II. index.html



  
    
    NginxDockerize static html
  
  
    

You known, Docker Nginx.

III. Build (work in folder nginx_static)

docker build -t nginx_static .

IV. Run

docker run -d --name nginx_static -p 80:80 nginx_static

V. Result

osx visit: http://192.168.99.100


nginx_dockerize_static_html.png

Update index.html



  
    
    NginxDockerize static html
  
  
    

You known, Docker Nginx.

Need update

https://ruby-china.org/topics/25477 http://www.gulpjs.com.cn/ http://leveluptuts.com/tutorials/learning-gulp http://markpop.github.io/2014/09/17/Gulp%E5%85%A5%E9%97%A8%E6%95%99%E7%A8%8B/

stop & delete runing nginx_static

docker stop nginx_static
docker rm nginx_static

re-build nginx_static

docker build -t nginx_static .

re-run

docker run -d --name nginx_static -p 80:80 nginx_static

Result

osx visit: http://192.168.99.100


nginx_dockerize_static_html_update.png

你可能感兴趣的:(Dockerize static html with nginx)