Home>

How to configure DockerFile for a simple static web application?

There is a maximum simple Web page HTML + CSS, tried to start using a dock on NGINX, but nothing is displayed.

Project folder:

dockerfile:

from nginx
Copy CSS ./css
Copy img ./img.
Copy index.html ./

Put the Docker Build -t Catapp. After that Docker Run --rm -it -p 80:80 Catapp

I go to LocalHost: 80, and there it

  • Answer # 1

    You need to copy your static files in USR /SHARE /NGINX /HTML .

    For example:

    from nginx: alpine
    Workdir /USR /Share /Nginx /HTML /
    Copy CSS ./css
    Copy img ./img.
    Copy index.html ./
    
  • Answer # 2

    You need to copy your static files in USR /SHARE /NGINX /HTML .

    For example:

    from nginx: alpine
    Workdir /USR /Share /Nginx /HTML /
    Copy CSS ./css
    Copy img ./img.
    Copy index.html ./