DEV Community

Discussion on: Deploying containerized NginX to Heroku - how hard can it be?

Collapse
 
annisalli profile image
Anniina Sallinen • Edited

You are right! The app and load balancer would have a separate containers. In this case we don't have separate application, though.
In the Dockerfile RUN jekyll build generates static HTML pages, and in COPY --from=build-stage /usr/src/app/_site/ /usr/share/nginx/html we copy the generated pages for nginx to use. In nginx config, we tell nginx to serve those pages in

location / {
    root /usr/share/nginx/html;
    index index.html;
  }   
Enter fullscreen mode Exit fullscreen mode

Thus, we don't need any other containers.

Did I answer to your question? 😊

Collapse
 
narasimha1997 profile image
Narasimha Prasanna HN

Yes! Thanks 😀
Maybe I didn't go through the Dockerfile properly. For static sites this is a good approach.