Giter Site home page Giter Site logo

springbootdemo's Introduction

SpringBootDemo

Build Status

SpringBoot RESTful API的例子,组织工程架构,作为基础工程使用。

主要技术方案

  • SpringBoot 2.x
  • MySQL 8.0
  • JPA
  • Swagger

开发构建环境

  • OpenJDK 11
  • Gradle 5.0
  • Docker

开发环境配置

首先创建docker环境变量:

cp .example.env .env

1. 配置数据库和Redis

docker-compose up -d mysql redis

2. IDE插件

  • IDE需配置Lombok相关插件,并开启Java注解处理器(Enable annotation processors)。

3. 运行

使用IDE或直接执行:

./gradlew bootRun

3. 查看API

使用Docker部署

为了充分利用gradle缓存,分为编译和构建镜像两步。

1. 编译

方式一:使用Docker

docker-compose -f docker-compose-gradle.yml up

方式二:本地有JDK11环境

./gradlew assemble

2. 构建运行

docker-compose up -d --build

映射的端口:API:8080,MySQL:3406,Redis:6479。

默认配置说明

在项目同级目录下会创建"SpringBootDemo_DATA"文件夹,用于存放日志和相关docker宿主目录绑定。

其他

  • 与项目名称有关的配置都以"SpringBootDemo"开头,所以修改项目名称时,替换成自己想要的名称即可。
  • IDE需配置Lombok相关插件,并开启Java注解处理器(Enable annotation processors)。

Links

springbootdemo's People

Contributors

shuai132 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.