Skip to content

Latest commit

 

History

History
34 lines (28 loc) · 782 Bytes

README.md

File metadata and controls

34 lines (28 loc) · 782 Bytes

springboot-docker

mysql start

$ mkdir -p ~/.docker-data/mysql

$ docker run --cap-add=sys_nice -d --restart=always -p 3306:3306 -e MYSQL_ROOT_PASSWORD=password \
-v ~/.docker-data/mysql:/var/lib/mysql \
--name mysql-ask mysql:8.0.34 \
--character-set-server=utf8mb4 \
--collation-server=utf8mb4_unicode_ci

create database

$ docker exec -it mysql-ask bash
# mysql -uroot -ppassword
mysql> create database if not exists order_service;

docker build

$ docker build --no-cache -t seungkyua/springboot-docker -f docker/Dockerfile .

docker run

$ docker run -d --name springboot --rm -p 19090:19090 --link mysql-ask:localhost seungkyua/springboot-docker

check

$ curl http://127.0.0.1:19090/orders/1