I wrote such a docker file, run the container and open localhost, opens nginx, although the site should open from the /var/www/html folder . How to solve the problem?
FROM nginx
RUN apt-get update && apt-get -y install zip
WORKDIR /02_Continuous_Delivery/html
COPY . /var/www/html
RUN rm -f /var/www/html/site.zip; zip -r /var/www/html/site.zip /02_Continuous_Delivery/html
EXPOSE 80
2
Answers
i have a solution
Your problem is that by default nginx image provides config (/etc/nginx/conf.d/default.conf) like this:
So, you should either copy your site to /usr/share/nginx/html directory or provide your custom config and set there location root as /var/www/html directory.
For second solution you can create file default.conf with content like:
and copy it to /etc/nginx/conf.d/ directory in your Dockerfile