Skip to content

Commit 8e8c47e

Browse files
committed
update: README.md & deploy
1 parent 4989f85 commit 8e8c47e

File tree

8 files changed

+125
-31
lines changed

8 files changed

+125
-31
lines changed

.github/workflows/docker-publish.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,28 @@ jobs:
1919

2020
steps:
2121
- name: Checkout repository
22-
uses: actions/checkout@v2
22+
uses: actions/checkout@v3
2323

2424
# Workaround: https://github.com/docker/build-push-action/issues/461
2525
- name: Setup Docker buildx
26-
uses: docker/setup-buildx-action@v1
26+
uses: docker/setup-buildx-action@v2
2727

2828
- name: Log into registry ${{ env.REGISTRY }}
29-
uses: docker/login-action@v1
29+
uses: docker/login-action@v2
3030
with:
3131
registry: ${{ env.REGISTRY }}
3232
username: ${{ github.actor }}
3333
password: ${{ secrets.GHCR_PAT }}
3434

3535
- name: Extract Docker metadata
3636
id: meta
37-
uses: docker/metadata-action@v3
37+
uses: docker/metadata-action@v4
3838
with:
3939
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4040

4141
- name: Build and push Docker image
4242
id: build-and-push
43-
uses: docker/build-push-action@v2
43+
uses: docker/build-push-action@v4
4444
with:
4545
context: .
4646
file: ./deploy/docker/chn.Dockerfile

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.PHONY: run build
22

33
# $(shell git rev-parse --short HEAD)
4-
VERSION := 0.0.3
4+
VERSION := 0.1.0
55

66
run:
77
go run ./cmd/app/main.go

README.md

Lines changed: 103 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,103 @@
1-
# admin-go
2-
A Management System powered by Go.
1+
<!-- PROJECT SHIELDS -->
2+
[![LICENSE](https://img.shields.io/github/license/basefas/admin-go.svg?style=flat-square)](/LICENSE)
3+
[![Releases](https://img.shields.io/github/release/basefas/admin-go/all.svg?style=flat-square)](https://github.com/basefas/admin-go/releases)
4+
![GitHub Repo stars](https://img.shields.io/github/stars/basefas/admin-go?style=social)
5+
6+
<!-- PROJECT LOGO -->
7+
<br />
8+
<div align="center">
9+
<a>
10+
<img src="https://raw.githubusercontent.com/basefas/files/main/logo.svg" alt="Logo" width="80" height="80">
11+
</a>
12+
13+
<h3 align="center">admin-go</h3>
14+
15+
<p align="center">
16+
一个使用 Go 语言开发的管理系统
17+
<br />
18+
</p>
19+
</div>
20+
21+
<!-- Introduction -->
22+
23+
## 简介
24+
25+
admin 使用 Go & Gin & Gorm 开发,包含常用后台使用的基本模块,同时提供完整功能的前端程序,可快速用于二次开发及功能扩展。
26+
27+
28+
| | url | introduction |
29+
|-----------|---------------------------------------------|--------------------------------------------|
30+
| backend | https://github.com/basefas/admin-go | 使用 Go & Gin 开发的后台管理系统后端 |
31+
| frontend | https://github.com/basefas/react-antd-admin | 使用 react & vite & antd 开发的后台管理系统前端|
32+
33+
34+
## 页面截图
35+
36+
### 登录页面
37+
38+
![Screen Shot](https://github.com/basefas/files/blob/main/login.png)
39+
40+
### 用户管理
41+
42+
![Screen Shot](https://github.com/basefas/files/blob/main/user.png)
43+
44+
### 分组管理
45+
46+
![Screen Shot](https://github.com/basefas/files/blob/main/group.png)
47+
48+
### 菜单管理
49+
50+
![Screen Shot](https://github.com/basefas/files/blob/main/menu.png)
51+
52+
### 角色及权限管理
53+
54+
![Screen Shot](https://github.com/basefas/files/blob/main/permission.png)
55+
56+
57+
<!-- GETTING STARTED -->
58+
59+
## 快速开始
60+
61+
1. 克隆项目到本地
62+
63+
```
64+
git clone https://github.com/basefas/admin-go
65+
```
66+
67+
2. 安装依赖
68+
69+
```
70+
go mod download
71+
```
72+
73+
3. 运行
74+
75+
```
76+
go run ./cmd/app/main.go
77+
```
78+
79+
<!-- USE DOCKER -->
80+
81+
## 使用 Docker 部署
82+
83+
> 注:需要提前安装好 docker 和 docker-compose
84+
85+
1. 切换目录
86+
87+
```
88+
cd ./deploy/docker-compose
89+
```
90+
91+
2. 使用 docker-compose 一键部署
92+
93+
```
94+
docker-compose up -d
95+
```
96+
97+
3. 可以根据需要修改该文件夹下的配置文件及镜像版本
98+
99+
<!-- LICENSE -->
100+
101+
## 版权声明
102+
103+
admin-go 基于 MIT 协议, 详情请参考 [license](LICENSE)

deploy/docker-compose/config/config.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

deploy/docker-compose/docker-compose.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: '3'
33
services:
44

55
mysql:
6-
image: mysql/mysql-server:5.7
6+
image: mysql/mysql-server:8.0
77
environment:
88
MYSQL_ROOT_PASSWORD: "root"
99
MYSQL_USER: "root"
@@ -19,7 +19,7 @@ services:
1919
- "13306:3306"
2020

2121
admin-go:
22-
image: ghcr.io/basefas/admin-go:v0.0.3
22+
image: ghcr.io/basefas/admin-go:v0.1.0
2323
volumes:
2424
- ./config/app-config.yaml:/usr/src/app/config/app-config.yaml
2525
depends_on:
@@ -31,9 +31,7 @@ services:
3131
- "8086:8086"
3232

3333
react-antd-admin:
34-
image: ghcr.io/basefas/react-antd-admin:v0.0.3
35-
volumes:
36-
- ./config/config.js:/usr/share/nginx/html/config/config.js
34+
image: ghcr.io/basefas/react-antd-admin:v0.1.0
3735
depends_on:
3836
- admin-go
3937
restart: always

deploy/docker/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
FROM golang:1.17 as builder
1+
FROM golang:1.19-alpine as builder
22
ENV CGO_ENABLED 0
3-
WORKDIR /usr/src/app/
3+
WORKDIR /app
44
COPY go.mod go.sum ./
55
RUN go mod download
66
COPY ./ ./
7-
RUN GOOS=linux GOARCH=amd64 go build -o ./bin/admin-go cmd/app/main.go
7+
RUN go build -o ./bin/app cmd/app/main.go
88

9-
FROM alpine:3.14
10-
WORKDIR /usr/src/app/
11-
COPY --from=builder /usr/src/app/bin/admin-go ./
9+
FROM alpine
10+
WORKDIR /app
11+
COPY --from=builder /app/bin/app ./
1212
ENTRYPOINT ["./app"]

deploy/docker/chn.Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
FROM golang:1.17 as builder
1+
FROM golang:1.19 as builder
22
ENV CGO_ENABLED 0
33
ENV GOPROXY https://goproxy.cn
4-
WORKDIR /usr/src/app/
4+
WORKDIR /app
55
COPY go.mod go.sum ./
66
RUN go mod download
77
COPY ./ ./
8-
RUN GOOS=linux GOARCH=amd64 go build -o ./bin/admin-go cmd/app/main.go
8+
RUN go build -o ./bin/admin-go cmd/app/main.go
99

10-
FROM alpine:3.14
11-
WORKDIR /usr/src/app/
10+
FROM alpine
11+
WORKDIR /app
1212
RUN apk --no-cache add ca-certificates tzdata && \
1313
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
1414
echo 'Asia/Shanghai' >/etc/timezone
15-
COPY --from=builder /usr/src/app/bin/admin-go ./
15+
COPY --from=builder /app/bin/admin-go ./
1616
ENTRYPOINT ["./admin-go"]

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module admin-go
22

3-
go 1.17
3+
go 1.19
44

55
require (
66
github.com/casbin/casbin/v2 v2.41.1

0 commit comments

Comments
 (0)