Skip to content

Repository used to be trainning devops (docker, docker-compose, nginx, gitlab-ci, traefik, ansible) with java stack (java, maven, spring-boot, kafka and mysql)

Notifications You must be signed in to change notification settings

leonardovff/spring-boot-devops

Repository files navigation

pipeline status coverage

Ansible

1. Copy the external_vars.example.yml to ansible-playbooks/vars/external_vars.yml and setting the token in it

cp external_vars.example.yml ansible-playbooks/vars/external_vars.yml

2. Install ansible and configure the hosts in /etc/ansible/hosts

With private key

3. Run ansible playbook

ansible-playbook ansible-playbooks/runner-docker-build.yml

Installation

with docker-compose

1. Copy the env-example to .env and setting it

and the copy the dbpassword to .dbpassword

cp env-example .env
cp dbpassword .dbpassword

2. Build and up the container with mysql

docker-compose up -d db

3. Build and up the containers with the application

docker-compose up -d app1 app2 app3

4. Build and up the container with proxy

docker-compose up -d proxy

5. Open the get url http://localhost:8080/users on browser

6. Or send a post to url http://localhost:8080/users on client http

without docker-compose

1. Copy the env-example to .env and setting it

cp env-example .env

2. Create a shared local ethernet network

docker network create -d bridge my-bridge-network 

3. Build and up the container with mysql

# build the container
docker build -t devops/db ./docker-config/db
# build run the container in daemon mode
docker run --rm -d -h db -p 1000:3600 --env-file ./.env --network=devops-network devops/db

4. Build and up the container with the application

# build the container
docker build -t devops/app -f ./docker-config/app/Dockerfile .
# build run the container in daemon mode
docker run --rm -d -h app -p 9000:8080 --env-file ./.env --network=devops-network devops/app 

5. Open the get url http://localhost:8080/users on browser

6. Or send a post to url http://localhost:8080/users on client http

to local development

1. Install dependecies

mvn install

2. Run the application

mvn spring-boot:run

About

Repository used to be trainning devops (docker, docker-compose, nginx, gitlab-ci, traefik, ansible) with java stack (java, maven, spring-boot, kafka and mysql)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published