File tree Expand file tree Collapse file tree 7 files changed +105
-13
lines changed Expand file tree Collapse file tree 7 files changed +105
-13
lines changed Original file line number Diff line number Diff line change @@ -115,14 +115,18 @@ go get -u github.com/swaggo/swag/cmd/swag
115115````
116116
117117##### (2)无法翻墙
118- 由于国内没法安装 go.org/x 包下面的东西,需要先安装` gopm `
118+
119+ 由于国内没法安装 go.org/x 包下面的东西,推荐使用 [ goproxy.io] ( https://goproxy.io/zh/ )
119120
120121``` bash
121- # 下载gopm包
122- go get -v -u github.com/gpmgo/gopm
122+ 如果您使用的 Go 版本是 1.13 及以上(推荐)
123+ # 启用 Go Modules 功能
124+ go env -w GO111MODULE=on
125+ # 配置 GOPROXY 环境变量
126+ go env -w GOPROXY=https://goproxy.io,direct
123127
124128# 执行
125- gopm get -g -v github.com/swaggo/swag/cmd/swag
129+ go get -g -v github.com/swaggo/swag/cmd/swag
126130
127131# 到GOPATH的/src/github.com/swaggo/swag/cmd/swag路径下执行
128132go install
Original file line number Diff line number Diff line change @@ -116,14 +116,23 @@ go build
116116go get -u github.com/swaggo/swag/cmd/swag
117117````
118118
119- ##### (2) In mainland China
120- In mainland China, access to go.org/x is prohibited,we recommend ` gopm `
119+ ##### (2) In mainland China
120+
121+ In mainland China, access to go.org/x is prohibited,we recommend [ goproxy.io] ( https://goproxy.io/zh/ )
122+
121123```` bash
122- # install gopm
123- go get -v -u github.com/gpmgo/gopm
124+
125+ If you are using Go version 1.13 and above (recommended)
126+ # Enable Go Modules function
127+ go env -w GO111MODULE=on
128+ # Configure GOPROXY environment variables
129+ go env -w GOPROXY=https://goproxy.io,direct
130+ If you are using Go version 1.12 and below
131+ go env -w GO111MODULE=on
132+ go env -w GOPROXY=https://goproxy.io
124133
125134# get swag
126- gopm get -g -v github.com/swaggo/swag/cmd/swag
135+ go get -g -v github.com/swaggo/swag/cmd/swag
127136
128137# cd GOPATH/src/github.com/swaggo/swag/cmd/swag
129138go install
Original file line number Diff line number Diff line change 1+ version : " 3.8"
2+
3+ services :
4+ server :
5+ build :
6+ context : ./
7+ dockerfile : ./dockerfile_server
8+ container_name : gva-server # 容器名
9+ restart : always
10+ ports :
11+ - ' 8888:8888'
12+ depends_on :
13+ - mysql
14+ - redis
15+
16+ mysql :
17+ image : registry.cn-shanghai.aliyuncs.com/gva/gva-mysql:1.1
18+ container_name : gva-mysql
19+ command : mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci # 设置utf8字符集
20+ restart : always
21+ ports :
22+ - " 3306:3306" # host物理直接映射端口为6606
23+ environment :
24+ MYSQL_ROOT_PASSWORD : " Aa@6447985" # root管理员用户密码
25+
26+ redis :
27+ image : redis:6.0.6
28+ container_name : gva-redis # 容器名
29+ restart : always
30+ ports :
31+ - ' 6379:6379'
Original file line number Diff line number Diff line change 1+ FROM node:12.16.1 as gva-web
2+
3+ WORKDIR /gva_web/
4+ COPY web/ .
5+ RUN npm install -g cnpm --registry=https://registry.npm.taobao.org
6+ RUN cnpm install || npm install
7+ RUN npm run build
8+
9+ FROM golang:alpine as gva-server
10+
11+ ENV GO111MODULE=on
12+ ENV GOPROXY=https://goproxy.io,direct
13+ WORKDIR /go/src/gin-vue-admin
14+ COPY server/ ./
15+ RUN go env && go list && go build -o gva-server .
16+
17+
18+ FROM nginx:alpine
19+ LABEL MAINTAINER="SliverHorn"
20+
21+ WORKDIR gva/
22+
23+ # copy web
24+ COPY --from=gva-web /gva_web/dist ./resource/dist
25+ # copy server
26+ COPY --from=gva-server /go/src/gin-vue-admin/gva-server ./
27+ COPY --from=gva-server /go/src/gin-vue-admin/config.yaml ./
28+ COPY --from=gva-server /go/src/gin-vue-admin/resource ./resource
29+
30+
31+ EXPOSE 8888
32+
33+ ENTRYPOINT ./gva-server
34+
35+ # 根据Dockerfile生成Docker镜像
36+
37+ # docker build -t gva-server:1.0 .
38+
39+ #- 根据Docker镜像启动Docker容器
40+ # - 后台运行
41+ # - ```
42+ # docker run -d -p 8888:8888 --name gva-server-v1 gva-server:1.0
43+ # ```
44+ # - 以可交互模式运行, Ctrl + p + q
45+ # - ```
46+ # docker run -it -p 8888:8888 --name gva-server-v1 gva-server:1.0
47+ # ```
Original file line number Diff line number Diff line change 1212mysql :
1313 username : root
1414 password : ' Aa@6447985'
15- path : ' 127.0.0.1:3306 '
15+ path : mysql
1616 db-name : ' qmPlus'
1717 config : ' charset=utf8&parseTime=True&loc=Local'
1818 max-idle-conns : 10
@@ -36,13 +36,13 @@ qiniu:
3636
3737# redis configuration
3838redis :
39- addr : ' 127.0.0.1 :6379'
39+ addr : redis :6379
4040 password : ' '
4141 db : 0
4242
4343# system configuration
4444system :
45- use-multipoint : false
45+ use-multipoint : true
4646 env : ' public' # Change to "develop" to skip authentication for development mode
4747 addr : 8888
4848 db-type : " mysql" # support mysql/sqlite
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ func RunWindowsServer() {
1818 }
1919 Router := initialize .Routers ()
2020 Router .Static ("/form-generator" , "./resource/page" )
21+ Router .Static ("/admin" , "./resource/dist" )
2122
2223 //InstallPlugs(Router)
2324 // end 插件描述
Original file line number Diff line number Diff line change 11ENV = ' production'
2- VUE_APP_BASE_API = ' /v1 '
2+ VUE_APP_BASE_API = ' '
You can’t perform that action at this time.
0 commit comments