Tuesday, April 5, 2022

Docker - Springboot and mysql image example

A simple docker example using springboot and database as mysql/mariadb

Create springboot image

Get the completed springboot source code on github for hello-docker image

1. Create docker image

    cd hello-docker
  docker build --tag hello-docker .

2. Tag the image
    
    docker tag hello-docker madan712/hello-docker:v1.0 

Run individual container(s) in a docker network

Since springboot application need to connect to database, both the containers should be present in same docker network.

1. Created docker network

    docker network create mynetwork

2. Run database image in docker network

    docker run -d --name mysqldb -p 3306:3306  -e MYSQL_ROOT_PASSWORD=pass123 -e MYSQL_DATABASE=mydb --network mynetwork mysql

3. Run springboot application

    docker run -d --name hello-docker -p 8080:8080 -e SPRING_DATASOURCE_URL="jdbc:mysql://mysqldb:3306/mydb?useSSL=false" -e SPRING_DATASOURCE_USERNAME=root -e SPRING_DATASOURCE_PASSWORD=pass123 --network mynetwork madan712/hello-docker:v1.0

Run multi-container docker application using docker compose

docker-compose.yaml


Compose command

docker-compose up -d

Please find complete github code - hello-docker

Wednesday, February 9, 2022

React native swipe gestures handler example

This is a simple 2048 game demonstrates how to use gestures handler in react native


It is hosted in play store, feel free to install and see the demo

It is using npm react-native-swipe-gestures package to detect swipe. this component can be used handling swipe gestures in up, down, left and right direction.

Here is the complete github code link

https://github.com/madan712/2048

Code snippet


Sunday, January 30, 2022

React native draggable and swipeable list

This is a simple todo app demonstrates how to create a draggable and swipeable list in react native

An open source todo app hosted in google play store. Feel free to download and play with it.


Here is the complete github code link

https://github.com/madan712/simple-todo-app

Code snippet