更新 README.md

This commit is contained in:
Hzbb 2024-10-13 10:35:44 +00:00
parent 1b5e68eea9
commit fec87cbc99

View File

@ -1,39 +1,41 @@
# Spring Boot Hello World # Spring Boot Hello World
一个使用docker构建docker-compose管理启动的Spring Boot测试应用程序
A spring boot enabled hello world application
[![Build Status](https://travis-ci.org/gazgeek/springboot-helloworld.svg?branch=master)](https://travis-ci.org/gazgeek/springboot-helloworld) ## 使用命令
[![Coverage Status](https://coveralls.io/repos/gazgeek/springboot-helloworld/badge.svg)](https://coveralls.io/r/gazgeek/springboot-helloworld) - 创建服务并启动服务
- Travis CI build and test
- Continuous deployment to Heroku on success
## Usage
- Directly using maven
``` ```
mvn spring-boot:run docker-compose up -d
``` ```
- From within your IDE right click run - 启动服务
``` ```
Application.java docker-compose start
``` ```
- From executable jar file - 停止服务
``` ```
mvn clean install docker-compose stop
java -jar target/helloworld-0.0.1-SNAPSHOT.jar
``` ```
- To run this as a docker application (assumption docker is installed on your machine) - 重启服务
``` ```
docker pull gazgeek/springboot-helloworld docker-compose restart
docker container run -p 8080:8080 -d gazgeek/springboot-helloworld
Go to Browser and type http://localhost:8080/ or do curl http://localhost:8080/ on command prompt
``` ```
- 销毁服务
```
docker-compose down
```
- 销毁服务及镜像,下次重新编译打包
```
docker-compose down --rmi local
```
- 只构建镜像
```
docker build -t springboot-helloworld:v0.0.1 .
```