GithubHelp home page GithubHelp logo

blog's Introduction

简介

基于SpringBoot搭建的开源个人博客系统,前台界面基于 Hexo 主题hexo-theme-gal进行修改,管理后台界面基于vue-element-admin进行修改。

技术栈:SpringBoot、Thymeleaf、MySQL、MyBatis-Plus、Lombok、Gson、caffeine、validation、Bootstrap、jQuery、FontAwesome、Jsoup……

示例博客:周华个人博客

快速开始

  1. 下载本项目,并使用 IDE 打开

  2. 新建数据库 blog 并运行项目

    现在运行项目会自动运行 SQL 脚本建表和插入初始数据

  3. 修改application-dev.yml中的数据库配置信息

  4. 运行BlogApplication.java,启动项目

  5. 浏览器访问http://127.0.0.1:8080/

使用 Idea,Eclipse 等 IDE 运行需要安装 Lombok 插件,JDK 版本要求 1.8+。

部署

jar 部署

配置好application-prod.yml中的配置信息,然后打包:

mvn clean package -Dmaven.test.skip=true

将打包好的blog.jarblog.sh放到同一文件夹下,执行命令:

# 使脚本具有执行权限
chmod +x ./blog.sh
# 启动项目
./blog.sh start
# 或者直接使用sh命令运行脚本
sh blog.sh start

tomcat 部署

修改application.ymlspring.profiles.activeprod,并配置好application-prod.yml中的配置信息。

直接修改pom.xml中的打包方式为 war 后进行打包,或直接运行命令:

clean package war:war -Dmaven.test.skip=true

然后将打包好的blog.war丢进 tomcat 中运行即可!

docker 部署

配置好application-prod.yml中的配置信息,然后执行build-docker.sh

# docker打包
sh build-docker.sh
# 运行项目
docker run -d --name blog -p 8080:8080 --add-host=host.docker.internal:host-gateway -v /data/logs:/app/logs -v /data/upload:/app/src/main/resources/static/upload blog
  • --add-host=host.docker.internal:host-gateway: 使镜像可通过 host.docker.internal 连接到宿主机的端口
  • -v /data/logs:/app/logs: 日志挂载
  • -v /data/upload:/app/src/main/resources/static/upload 上传图片挂载,非本地存储无需挂载

注:build-docker.sh 脚本会自动将 vue 代码也编译进 docker 镜像中,无需单独处理 vue 的内容

后台管理

后台采用前后端分离的方式实现,源码位于 vue 文件夹下https://github.com/iszhouhua/blog/tree/master/vue


blog's People

Contributors

dependabot[bot] avatar im-andy avatar iszhouhua avatar levanliu 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.