Fish 是一个使用 Spring Boot + Spring Security + JWT 开发的基于 RBAC 权限控制的快速启动器。
前端项目为 d2-admin-fish
缓存使用了 Redis,因此需要先启动一个 Redis Server 服务,然后再启动主程序。
- 打包
$ mvn clean package
- 启动
$ cd target && java -jar fish-0.0.1-SNAPSHOT.jar
- 构建镜像
需要注意的是,构建使用了多阶段构建。在第一个阶段使用了非官方的 Maven Image(它是在官方镜像的基础上修改了 Maven 的配置文件,加入了阿里云 Mirror 来加速构建过程)编译项目,因此需要先在服务器上构建该 Maven 镜像。
$ docker build --build-arg VERSION=0.0.1.RELEASE --no-cache -t nekolr/fish:0.0.1 .
- 运行容器
$ docker run --env VERSION=0.0.1.RELEASE \
--name fish -dit \
--network=host \
nekolr/fish:0.0.1