This project creates a complete micro service chat system in Docker containers. The services are implemented in Java using Spring, Spring Cloud and RabbitMQ. It uses 5 microservices:
- Mail service
- Websocket service
- Messages storing service
- Chat profiles service
- Auth service
- Eureka
- Spring Cloud Gateway
- Spring Cloud Config Server
- MySql and MongoDB
- WebFlux
- RabbitMQ (AMQP + STOMP)
Requirements:
- Install Maven, see https://maven.apache.org/download.cgi
- Install Docker, see https://docs.docker.com/get-docker
git clone https://github.com/kubAretip/spring-micro-websocket-chat.git
- In this moment repositories with configuration files is public so you must remove configuration for privates repositories.
- Go to config-server/src/main/resources open bootstrap-docker.yml and remove properties
ignore-local-ssh-settings:
,host-key-algorithm:
,host-key:
andprivate-key:
- Go to docker folder and open .env.docker. Next fill
REPO_BRANCH=master
andGIT_REPO_URI=
. Link to config repo below: https://github.com/kubAretip/spring-micro-websocket-chat-config - Go to docker folder and open docker-compose-docker.yml. In services section find config-server and remove environments variables:
HOST_KEY: ${KNOWN_HOST_KEY}
,PRIVATE_KEY: ${PEM}
- In spring-micro-websocket-chat run
mvn clean package
- Inside docker folder run
docker-compose -f docker-compose-docker.yml --env-file .env.docker up -d
and ... - ... wait a moment, docker compose builds the docker images and runs them.
- You can access the application at http://localhost:8080
- Documentation with application endpoints is available on http://localhost:8080/swagger-ui.html PS-1 If you don't see anything in Swagger UI, you must restart the gateway. It's happen because gateway has been in ready state before services, so gateway can't see Swagger endpoints from services. You can use Actuator to restart the gateway (POST http://localhost:8080/actuator/restart).