perf👌: 添加演示环境配置项

This commit is contained in:
zhangwenjian committed 2022-11-01 14:58:18 +08:00
1 parent f795a356e7
commit d56142463a
2 files changed
+47 -24

No files matched your search

+13 -24
View File
@@ -1,29 +1,18 @@
FROM golang:alpine as builder
FROM alpine
MAINTAINER haimait
# ENV GOPROXY https://goproxy.cn/
WORKDIR /work
RUN go env -w GOPROXY=https://goproxy.cn,direct && go env -w CGO_ENABLED=0
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build -o go-admin main.go
FROM alpine:latest
# change timezone
RUN apk add --no-cache tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone
WORKDIR /go-admin-api
COPY --from=builder /work/go-admin ./
COPY --from=builder /work/config ./config
COPY --from=builder /work/static ./static
COPY --from=builder /work/temp ./temp
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN apk update --no-cache
RUN apk add --update gcc g++ libc6-compat
RUN apk add --no-cache ca-certificates
RUN apk add --no-cache tzdata
ENV TZ Asia/Shanghai
COPY ./main /main
COPY ./config/settings.demo.yml /config/settings.yml
COPY ./go-admin-pro.db /go-admin-pro.db
EXPOSE 8000
CMD ["./go-admin","server","-c", "config/settings.dev.yml"]
RUN chmod +x /main
CMD ["/main","server","-c", "/config/settings.yml"]
+34
View File
@@ -0,0 +1,34 @@
settings:
application:
demomsg: "谢谢您的参与,但为了大家更好的体验,所以本次提交就算了吧!\U0001F600\U0001F600\U0001F600"
enabledp: true
host: 0.0.0.0
mode: demo
name: testApp
port: 8000
readtimeout: 10000
writertimeout: 20000
database:
driver: sqlite3
source: ./go-admin-db.db
gen:
dbname: testhhh
frontpath: ../go-admin-ui/src
jwt:
secret: go-admin
timeout: 3600
logger:
# 日志存放路径
path: temp/logs
# 日志输出,file:文件,default:命令行,其他:命令行
stdout: '' #控制台日志,启用后,不输出到文件
# 日志等级, trace, debug, info, warn, error, fatal
level: trace
# 数据库日志开关
enableddb: true
queue:
memory:
poolSize: 100
extend:
amap:
key: de7a062c984bf828d5d1b3a631a517e4