Skip to content

Java APIs on Docker, Microservices communication, PostgreSQL, MongoDB and Javascript

License

Notifications You must be signed in to change notification settings

all-an/docker-microservices

Repository files navigation

Java APIs on Docker, Microservices communication, PostgreSQL, MongoDB and Javascript

Stack :

  • Java 17
  • Spring
  • Javascript
  • Express
  • Docker version 20.10.11, build dea9396
  • PostgreSQL 11
  • MongoDB 2.6
  • MongoDB Shell 1.1.7
  • DBeaver 21.3.1

Spring dependencies:

How to:

Install Postgres on Docker:

Database auth:

docker run --name auth-db -p 5432:5432 -e POSTGRES_DB=auth-db -e POSTGRES_USER=admin -e POSTGRES_PASSWORD=123456 postgres:11

Database products:

docker run --name product-db -p 5433:5432 -e POSTGRES_DB=product-db -e POSTGRES_USER=admin -e POSTGRES_PASSWORD=123456 postgres:11

Stopping container:

docker container stop <nome do container, ex: auth-db>

Visualize containers:

docker ps
docker container inspect <container> 

Remove all containers:

docker container prune

Visualize volumes:

docker volume ls

Remove volume:

docker volume rm <volume>

"startingDirectory": "%SystemDrive%/code/"

Running image mongo-express on docker:

docker run --name sales-db -p 27017:27017 -p 28017:28017 -e MONGODB_USER="admin" -e MONGODB_DATABASE="sales" -e MONGODB_PASS="123456" tutum/mongodb

MongoDB url connection:

mongo "mongodb://admin:123456@localhost:27017/sales"

RabbitMq on docker:

docker run --name sales_rabbit -p 5672:5672 -p 25676:25676 -p 15672:15672 rabbitmq:3-management

user:guest 
password:guest

auth-api / sales-api

yarn init -y
yarn add express
yarn add cors
yarn add jsonwebtoken

Running docker-compose build

para o primeiro build ou builds posteriores:
docker-compose up --build

depois:
docker-compose up

See logs

docker logs --follow <nome do container>

Stop all containers

docker kill $(docker ps -q)

About

Java APIs on Docker, Microservices communication, PostgreSQL, MongoDB and Javascript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published