Giter Site home page Giter Site logo

docker-nginx-intro's Introduction

Docker NGINX - NextJS - Express

Getting Started

Make sure you have Docker installed on your computer. You have to run the Express (API) & NextJS (blog) services first:

$ docker-compose up api blog

then, you have to run the nginx service in the new terminal

$ docker-compose up nginx

After all of the service running, you can open localhost:8080 in the browser to open the NextJS blog. But you may found an error. Your task is fixing the error by modifying nginx config (nginx/default.conf). You may need to restart/reload nginx everytime you make changes on nginx config, so you have to running a shell on nginx container. To achieve that, you can type in the new terminal:

$ docker-compose exec nginx sh

Please refer to nginx presentation or the video about how to test the config file (make sure it doesn't error) and reload the nginx.

Notion : https://mkhotib.notion.site/mkhotib/Nginx-Sharing-1b42b7df511b46b9b6783834650d163a Nginx Validator : https://nginx.viraptor.info/

You have a restriction to NOT modify the api service (we can assume this is backend which out of our control).

Required functionality:

  • Open the home page which has list of blog title
  • Open the post detail page
  • when open "/blog" it will serve the blog post page also
  • add trailing slash from all url

Stop the services

To stop all the running containers, you can run:

$ docker-compose down

docker-nginx-intro's People

Contributors

ikrydev avatar richaferry avatar afifkhaidir avatar ivqonsanada avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.