Git Product home page Git Product logo

feedboard's Introduction

FeedBoard - social network to post news or posts

Deployment

We will be run all applications on docker.

First, we need to have a network and bring all applications on that network

docker network create feedboard-net

Install and run mongodb instance as a container

To Make sure, we don't lose data if a container restarts or re-creates. So, volume is important.

docker run -d -p 27017:27017 --name feedboard-mongodb -v data:/data/db --network feedboard-net --rm mongo

Working on the server app

cd server

Build an image

docker build -t feedboard-server:1 .

Run the app

docker run -d -p 4000:4000 --env-file docker.env --name feedback-server-app --network feedboard-net --rm feedboard-server:1

Working on the client app

cd client

Build an image

docker build -t feedboard-client:1 .

Run the app

Since React app runs on a browser. So, it doesn't matter if that container in the same network. Also the rest api domain shouldn't point to a container name. We can leave as localhost.If needs then just apply changes in .env file -it(interactive mode) is important otherwise React app stops

docker run --name feedback-client-app -d -p 3000:3000 -it --rm feedboard-client:1

Deploy in prod

UI app

Use Dockerfile.prod to make an image

cd client

docker build -t feedboard-ui-prod -f Dockerfile.prod .

Run the build to validate docker run --name feedboard-ui-app -d -p 3000:80 -it --rm feedboard-ui-prod

Api app

cd server

docker build -t feedboard-backend-prod .

docker run -d -p 4000:80 --env-file docker.prod.env --name feedback-backend-app --rm feedboard-backend-prod

Push both images to docker hub.

Docker Compose

Run applications through docker-compose: Elegant Multi-Container Orchestration

To create and run services. Docker compose creates a default network for these service. So, doesn't need by default --build - it creates an image again otherwise it uses an existing

docker-compose up -d --build

To stop and remove created services. By default it doesnt remove volume. -v helps to remove docker-compose down -v

feedboard's People

Contributors

orifjon9 avatar

Stargazers

Farrukh  avatar  avatar

Watchers

James Cloos avatar  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.