正在显示
5 个修改的文件
包含
44 行增加
和
1 行删除
DockerfileMulStage
0 → 100644
| 1 | +FROM golang:1.19-alpine as builder | ||
| 2 | + | ||
| 3 | +# Define the project name | 定义项目名称 | ||
| 4 | +ARG PROJECT=core | ||
| 5 | + | ||
| 6 | +WORKDIR /build | ||
| 7 | +COPY . . | ||
| 8 | + | ||
| 9 | +RUN go env -w GO111MODULE=on \ | ||
| 10 | + && go env -w GOPROXY=https://goproxy.cn,direct \ | ||
| 11 | + && go env -w CGO_ENABLED=0 \ | ||
| 12 | + && go env \ | ||
| 13 | + && go mod tidy \ | ||
| 14 | + && cd cmd/chart-server/api \ | ||
| 15 | + && go build -ldflags="-s -w" -o /build/api/${PROJECT} ${PROJECT}.go | ||
| 16 | + | ||
| 17 | +FROM alpine:latest | ||
| 18 | + | ||
| 19 | +# Define the project name | 定义项目名称 | ||
| 20 | +ARG PROJECT=core | ||
| 21 | +# Define the config file name | 定义配置文件名 | ||
| 22 | +ARG CONFIG_FILE=core-dev.yaml | ||
| 23 | +# Define the author | 定义作者 | ||
| 24 | +ARG AUTHOR=785409885@qq.com | ||
| 25 | + | ||
| 26 | +LABEL org.opencontainers.image.authors=${AUTHOR} | ||
| 27 | + | ||
| 28 | +WORKDIR /app | ||
| 29 | +ENV PROJECT=${PROJECT} | ||
| 30 | +ENV CONFIG_FILE=${CONFIG_FILE} | ||
| 31 | + | ||
| 32 | +COPY --from=builder /build/api/${PROJECT} ./ | ||
| 33 | +COPY --from=builder /build/cmd/chart-server/api/etc/${CONFIG_FILE} ./etc/ | ||
| 34 | + | ||
| 35 | +EXPOSE 8080 | ||
| 36 | +ENTRYPOINT ./${PROJECT} -f etc/${CONFIG_FILE} |
| @@ -127,10 +127,12 @@ type Quarter struct { | @@ -127,10 +127,12 @@ type Quarter struct { | ||
| 127 | YAxisFirstLabel string `json:"yAxisFirstLabel"` // y标签1 | 127 | YAxisFirstLabel string `json:"yAxisFirstLabel"` // y标签1 |
| 128 | YAxisSecondLabel string `json:"yAxisSecondLabel"` // y标签2 | 128 | YAxisSecondLabel string `json:"yAxisSecondLabel"` // y标签2 |
| 129 | Area string `json:"area"` // 图形面积 | 129 | Area string `json:"area"` // 图形面积 |
| 130 | + AreaColor bool `json:"areaColor"` // 颜色 | ||
| 130 | SeriesList []QuarterSeries `json:"seriesList"` // 图形系列 | 131 | SeriesList []QuarterSeries `json:"seriesList"` // 图形系列 |
| 131 | } | 132 | } |
| 132 | 133 | ||
| 133 | type QuarterSeries struct { | 134 | type QuarterSeries struct { |
| 135 | + SeriesValue string `json:"seriesValue"` | ||
| 134 | } | 136 | } |
| 135 | 137 | ||
| 136 | type Title struct { | 138 | type Title struct { |
| @@ -37,9 +37,12 @@ type Quarter struct { | @@ -37,9 +37,12 @@ type Quarter struct { | ||
| 37 | YAxisFirstLabel string `json:"yAxisFirstLabel"` // y标签1 | 37 | YAxisFirstLabel string `json:"yAxisFirstLabel"` // y标签1 |
| 38 | YAxisSecondLabel string `json:"yAxisSecondLabel"` // y标签2 | 38 | YAxisSecondLabel string `json:"yAxisSecondLabel"` // y标签2 |
| 39 | Area string `json:"area"` // 图形面积 | 39 | Area string `json:"area"` // 图形面积 |
| 40 | + AreaColor bool `json:"areaColor"` // 颜色 | ||
| 40 | SeriesList []QuarterSeries `json:"seriesList"` // 图形系列 | 41 | SeriesList []QuarterSeries `json:"seriesList"` // 图形系列 |
| 41 | } | 42 | } |
| 43 | + | ||
| 42 | type QuarterSeries struct { | 44 | type QuarterSeries struct { |
| 45 | + SeriesValue string `json:"seriesValue"` | ||
| 43 | } | 46 | } |
| 44 | 47 | ||
| 45 | type Title struct { | 48 | type Title struct { |
| @@ -170,9 +170,11 @@ type( | @@ -170,9 +170,11 @@ type( | ||
| 170 | YAxisFirstLabel string `json:"yAxisFirstLabel"` // y标签1 | 170 | YAxisFirstLabel string `json:"yAxisFirstLabel"` // y标签1 |
| 171 | YAxisSecondLabel string `json:"yAxisSecondLabel"` // y标签2 | 171 | YAxisSecondLabel string `json:"yAxisSecondLabel"` // y标签2 |
| 172 | Area string `json:"area"` // 图形面积 | 172 | Area string `json:"area"` // 图形面积 |
| 173 | + AreaColor bool `json:"areaColor"` // 颜色 | ||
| 173 | SeriesList []QuarterSeries `json:"seriesList"` // 图形系列 | 174 | SeriesList []QuarterSeries `json:"seriesList"` // 图形系列 |
| 174 | } | 175 | } |
| 175 | QuarterSeries struct { | 176 | QuarterSeries struct { |
| 177 | + SeriesValue string `json:"seriesValue"` | ||
| 176 | } | 178 | } |
| 177 | Title struct { | 179 | Title struct { |
| 178 | TitleSwitch bool `json:"titleSwitch,optional"` // 组件标题开关 | 180 | TitleSwitch bool `json:"titleSwitch,optional"` // 组件标题开关 |
-
请 注册 或 登录 后发表评论