Giter VIP home page Giter VIP logo

fullstack-docker-project's Introduction

Project: Dockerizing a fullstack app (frontend+backend) with Postgres, Redis and Nginx

This project was basically from solutions to exercise of course https://devopswithdocker.com/. A frontend app which built on React, which accept request on port 5000. A backend app built on Go language, which accepts connections on port 8080. A SQL database server 'postgresql' and in-memory database 'redis' is connected to the backend server. Nginx will function as a reverse proxy. The requests arriving at anything other than /api will be redirected to frontend container and /api will get redirected to backend container. At the end the frontend is accessible simply by going to http://localhost. See the project diagram for understanding the app architecture.

Steps for Running

Features

  • Frontend written in React
  • Backend written in Go
  • PostgreSQL database connected to the Backend
  • In-memory database Redis to the Backend
  • Nginx as a Reverse Proxy

Project Diagram

Project Diagram

Exercise done on this project

  • Ex-1.12: Create a Dockerfile for Frontend and listens on port 5000
  • Ex-1.13: Create a Dockerfile for Backend and listens on port 8080
  • Ex-1.14: Exposed ports for frontend and backend correctly and frontend gets response from backend api when talk to browser
  • Ex-2.3: Configure the backend and frontend to work in docker-compose.
  • Ex-2.4: Using Docker Networking, redis is connected to the backend as docker container
  • Ex-2.6: connected to a postgres database to save messages. postgreql starts as docker container and configured to docker-compose file.
  • Ex-2.8: Add Nginx which will function as a reverse proxy (see the image above). The requests arriving at anything other than /api will be redirected to frontend container and /api will get redirected to backend container.
  • Ex-2.9-2.10: Complete all configurations on docker-compose so that the app start when "docker-compose up" command given and all services are accesible.
  • Ex-3.3: For security reasons, removed the root access and make sure the containers start their processes as a non-root user.
  • Ex-3.4-3.5: Optimize the size of the images
  • Ex-3.6: Multi-stage build for the backend app

Complete Project Screenshot

Project Diagram

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.