GithubHelp home page GithubHelp logo

aim467 / mypersonalblog Goto Github PK

View Code? Open in Web Editor NEW
4.0 0.0 1.0 27.31 MB

基于SpringBoot+Mybatis搭建的个人博客

Java 12.54% JavaScript 49.24% CSS 15.58% SCSS 5.28% HTML 17.30% Dockerfile 0.01% Shell 0.05%
blog mybatis mysql springboot

mypersonalblog's Introduction

关于项目

该项目是基于 SpringBoot + Mybatis 实现的个人博客系统。

主要的使用的技术和软件如下:

  • SpringBoot
  • Mybatis
  • Maven
  • MySQL
  • Idea

该项目的主要特性如下:

  • 使用阿里云OSS管理静态资源
  • 在编写文章时实现粘贴图片上传到阿里云OSS
  • 后台管理提供多种样式选择
  • ...

对于一个个人博客来说,这个博客系统还是有很多不完美的地方,只是达到了一个最基础最基础的博客系统该有的功能,在未来的话,我会持续为这个博客进行优化,争取做的更好。

效果预览

首页

分类页

文章详情页

后台登录页

文章管理页

如何运行

本地运行

请在 application-prod.yml 中完善数据库信息,并且设置 application.yml 中的 active 属性为 prod。数据库脚本和数据脚本已经导入 docs 文件夹,在本地的数据库中导入建表文件和数据之后,最后在 application.yml 中配置阿里云OSS配置属性,然后就可以运行了。

管理后台地址为:http://localhost:8080/admin/login 。 帐号:admin,密码:qwerty123_

docker 中部署

首先执行当前目录下的 install-mysql.sh,有几个变量可以自定义,详细注释已经写在 install-mysql.sh 内,请自行查看。执行完 install-mysql.sh 脚本后,执行下面的命令,用于导入建表脚本和数据脚本到上面创建的容器。注意 -i 参数后面的名字是容器名字,要和你创建的容器名字相对应。

docker exec -i blog-mysql mysql -uroot -p123456 blog < ./docs/schema.sql
docker exec -i blog-mysql mysql -uroot -p123456 blog < ./docs/data.sql

修改 resources/application-docker.yml ,配置正确的数据库连接并且在 application.yml 中设置 active 属性为 docker,同时配置 application.yml 中的阿里云 OSS 属性,最后执行下面命令。

# 确保 target 文件夹被清空
mvn clean 

# 发布 jar 包
mvn package

# 构建镜像
docker build -t blog:v1 .

最终,执行 docker run -p 9090:9090 --name blog --link blog-mysql:mysql5.6 -d blog:v1 运行,打开浏览器输入 http://127.0.0.1:9090 即可看到效果。

mypersonalblog's People

Contributors

aim467 avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Forkers

xiaojianbin001

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.