作者 唐旭辉

添加docker

FROM library/golang
FROM golang:1.13 as builder
ENV GOPROXY https://goproxy.cn
ENV GOPATH /go
ENV APP_DIR $GOPATH/src/oppmg
# Recompile the standard library without CGO
RUN CGO_ENABLED=0 go install -a std
ENV APP_DIR $GOPATH\src\oppmg
RUN mkdir -p $APP_DIR
# Set the entrypoint
ENTRYPOINT (cd $APP_DIR && ./\src\oppmg)
#ENTRYPOINT (cd $APP_DIR && ./\src\oppmg)
ADD . $APP_DIR
# Compile the binary and statically link
RUN cd $APP_DIR && CGO_ENABLED=0 go build -ldflags '-d -w -s'
WORKDIR $APP_DIR
EXPOSE 8080
... ...
... ... @@ -6,9 +6,9 @@ import (
//MyConfig 自定义配置选项
type MyConfig struct {
ConfigName string
SqlConn string
RedisAddPort string
ConfigName string //配置名称
SqlConn string //数据库连接
RedisAddPort string //
RedisAuth string
RedisDB string
LogOutput string
... ...