Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
nizhengjia888
gin-vue-admin
提交
7267761c
G
gin-vue-admin
项目概览
nizhengjia888
/
gin-vue-admin
与 Fork 源项目一致
Fork自
FLIPPED-AURORA / gin-vue-admin
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gin-vue-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7267761c
编写于
8月 06, 2020
作者:
Sliver_Horn
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增docker-compose的支持,文档说明取消gopm,改用Go Modules主流的代理模式
上级
7352a0f7
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
105 addition
and
13 deletion
+105
-13
README-zh_CN.md
README-zh_CN.md
+8
-4
README.md
README.md
+14
-5
docker-compose.yaml
docker-compose.yaml
+31
-0
dockerfile_server
dockerfile_server
+47
-0
server/config.yaml
server/config.yaml
+3
-3
server/core/server.go
server/core/server.go
+1
-0
web/.env.production
web/.env.production
+1
-1
未找到文件。
README-zh_CN.md
浏览文件 @
7267761c
...
...
@@ -115,14 +115,18 @@ go get -u github.com/swaggo/swag/cmd/swag
````
##### (2)无法翻墙
由于国内没法安装 go.org/x 包下面的东西,需要先安装
`gopm`
由于国内没法安装 go.org/x 包下面的东西,推荐使用
[
goproxy.io
](
https://goproxy.io/zh/
)
```
bash
# 下载gopm包
go get
-v
-u
github.com/gpmgo/gopm
如果您使用的 Go 版本是 1.13 及以上
(
推荐
)
# 启用 Go Modules 功能
go
env
-w
GO111MODULE
=
on
# 配置 GOPROXY 环境变量
go
env
-w
GOPROXY
=
https://goproxy.io,direct
# 执行
go
pm
get
-g
-v
github.com/swaggo/swag/cmd/swag
go get
-g
-v
github.com/swaggo/swag/cmd/swag
# 到GOPATH的/src/github.com/swaggo/swag/cmd/swag路径下执行
go
install
...
...
README.md
浏览文件 @
7267761c
...
...
@@ -116,14 +116,23 @@ go build
go get -u github.com/swaggo/swag/cmd/swag
````
##### (2) In mainland China
In mainland China, access to go.org/x is prohibited,we recommend
`gopm`
##### (2) In mainland China
In mainland China, access to go.org/x is prohibited,we recommend
[
goproxy.io
](
https://goproxy.io/zh/
)
````
bash
# install gopm
go get
-v
-u
github.com/gpmgo/gopm
If you are using Go version 1.13 and above
(
recommended
)
# Enable Go Modules function
go
env
-w
GO111MODULE
=
on
# Configure GOPROXY environment variables
go
env
-w
GOPROXY
=
https://goproxy.io,direct
If you are using Go version 1.12 and below
go
env
-w
GO111MODULE
=
on
go
env
-w
GOPROXY
=
https://goproxy.io
# get swag
go
pm
get
-g
-v
github.com/swaggo/swag/cmd/swag
go get
-g
-v
github.com/swaggo/swag/cmd/swag
# cd GOPATH/src/github.com/swaggo/swag/cmd/swag
go
install
...
...
docker-compose.yaml
0 → 100644
浏览文件 @
7267761c
version
:
"
3.8"
services
:
server
:
build
:
context
:
./
dockerfile
:
./dockerfile_server
container_name
:
gva-server
# 容器名
restart
:
always
ports
:
-
'
8888:8888'
depends_on
:
-
mysql
-
redis
mysql
:
image
:
registry.cn-shanghai.aliyuncs.com/gva/gva-mysql:1.1
container_name
:
gva-mysql
command
:
mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
#设置utf8字符集
restart
:
always
ports
:
-
"
3306:3306"
# host物理直接映射端口为6606
environment
:
MYSQL_ROOT_PASSWORD
:
"
Aa@6447985"
# root管理员用户密码
redis
:
image
:
redis:6.0.6
container_name
:
gva-redis
# 容器名
restart
:
always
ports
:
-
'
6379:6379'
\ No newline at end of file
dockerfile_server
0 → 100644
浏览文件 @
7267761c
FROM node:12.16.1 as gva-web
WORKDIR /gva_web/
COPY web/ .
RUN npm install -g cnpm --registry=https://registry.npm.taobao.org
RUN cnpm install || npm install
RUN npm run build
FROM golang:alpine as gva-server
ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.io,direct
WORKDIR /go/src/gin-vue-admin
COPY server/ ./
RUN go env && go list && go build -o gva-server .
FROM nginx:alpine
LABEL MAINTAINER="SliverHorn"
WORKDIR gva/
# copy web
COPY --from=gva-web /gva_web/dist ./resource/dist
# copy server
COPY --from=gva-server /go/src/gin-vue-admin/gva-server ./
COPY --from=gva-server /go/src/gin-vue-admin/config.yaml ./
COPY --from=gva-server /go/src/gin-vue-admin/resource ./resource
EXPOSE 8888
ENTRYPOINT ./gva-server
# 根据Dockerfile生成Docker镜像
# docker build -t gva-server:1.0 .
#- 根据Docker镜像启动Docker容器
# - 后台运行
# - ```
# docker run -d -p 8888:8888 --name gva-server-v1 gva-server:1.0
# ```
# - 以可交互模式运行, Ctrl + p + q
# - ```
# docker run -it -p 8888:8888 --name gva-server-v1 gva-server:1.0
# ```
\ No newline at end of file
server/config.yaml
浏览文件 @
7267761c
...
...
@@ -12,7 +12,7 @@ jwt:
mysql
:
username
:
root
password
:
'
Aa@6447985'
path
:
'
127.0.0.1:3306'
path
:
mysql
db-name
:
'
qmPlus'
config
:
'
charset=utf8&parseTime=True&loc=Local'
max-idle-conns
:
10
...
...
@@ -36,13 +36,13 @@ qiniu:
# redis configuration
redis
:
addr
:
'
127.0.0.1:6379'
addr
:
redis:6379
password
:
'
'
db
:
0
# system configuration
system
:
use-multipoint
:
fals
e
use-multipoint
:
tru
e
env
:
'
public'
# Change to "develop" to skip authentication for development mode
addr
:
8888
db-type
:
"
mysql"
# support mysql/sqlite
...
...
server/core/server.go
浏览文件 @
7267761c
...
...
@@ -18,6 +18,7 @@ func RunWindowsServer() {
}
Router
:=
initialize
.
Routers
()
Router
.
Static
(
"/form-generator"
,
"./resource/page"
)
Router
.
Static
(
"/admin"
,
"./resource/dist"
)
//InstallPlugs(Router)
// end 插件描述
...
...
web/.env.production
浏览文件 @
7267761c
ENV = 'production'
VUE_APP_BASE_API = '/v1'
\ No newline at end of file
VUE_APP_BASE_API = ''
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录