Files
daohangye/Dockerfile
T
Sun 956e645144 更新v1.3.0-beta24-01-25
Squashed commit of the following:

commit 66d0e5e94c
Author: Sun <95302870@qq.com>
Date:   Thu Jan 25 13:20:34 2024 +0800

    更新1.3.0-beta24-01-25

commit 52a81e5f55
Author: Sun <95302870@qq.com>
Date:   Thu Jan 25 13:13:08 2024 +0800

    Squashed commit of the following:

    commit 908d87357c4e22868eff85f377bb8cd22f3785d7
    Author: Sun <95302870@qq.com>
    Date:   Thu Jan 25 13:12:14 2024 +0800

        增加前端版本号

    commit 8ed2b636476c7a14ae4e1761f7712949b7ce60fc
    Author: Sun <95302870@qq.com>
    Date:   Thu Jan 25 12:29:49 2024 +0800

        增加自动获取前端版本号的git tag

commit ba7d70f9ca
Author: Sun <95302870@qq.com>
Date:   Thu Jan 25 10:58:15 2024 +0800

    优化代码

commit 104543b96f
Author: Sun <95302870@qq.com>
Date:   Wed Jan 24 21:28:31 2024 +0800

    增加系统状态组件的部分样式

commit 70c87c94c6
Author: Sun <95302870@qq.com>
Date:   Wed Jan 24 20:55:05 2024 +0800

    时间组件和搜索栏组件增加样式类型

commit 6bab5a264f
Author: Sun <95302870@qq.com>
Date:   Wed Jan 24 20:41:33 2024 +0800

    将项目列表增加样式并优化减少dom嵌套

commit 99d18df7f0
Author: Sun <95302870@qq.com>
Date:   Wed Jan 24 20:11:07 2024 +0800

    增加系统状态、logo等类名并简化部分组件dom

commit bf1cc0cc00
Author: Sun <95302870@qq.com>
Date:   Wed Jan 24 17:17:41 2024 +0800

    更新关于页面

commit fceacf58b8
Author: Sun <95302870@qq.com>
Date:   Wed Jan 24 14:54:37 2024 +0800

    增加隐藏网络模式切换开关

commit e0dcc49f5b
Author: Sun <95302870@qq.com>
Date:   Wed Jan 24 13:55:28 2024 +0800

    优化部分错误码

commit 863cdf0fc1
Author: Sun <95302870@qq.com>
Date:   Wed Jan 24 12:54:55 2024 +0800

    声明暴露端口

commit 5b25ef9c19
Author: Sun <95302870@qq.com>
Date:   Wed Jan 24 12:38:48 2024 +0800

    修改命令行所有的输出内容为英文
2024-01-25 13:21:47 +08:00

65 lines
1.6 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# build frontend
FROM node AS web_image
# 华为源
# RUN npm config set registry https://repo.huaweicloud.com/repository/npm/
RUN npm install pnpm -g
WORKDIR /build
COPY ./package.json /build
COPY ./pnpm-lock.yaml /build
RUN pnpm install
COPY . /build
RUN pnpm run build
# build backend
# 最新alpine3.19导致sqlite3编译失败(https://github.com/mattn/go-sqlite3/issues/1164
# 临时解决方案:https://github.com/mattn/go-sqlite3/pull/1177)
# sun-panel暂时解决方案使用golang:1.21-alpine3.18(因旧版本使用没问题,短期内较稳定)
FROM golang:1.21-alpine3.18 as server_image
WORKDIR /build
COPY ./service .
# 中国国内源
# RUN sed -i "s@dl-cdn.alpinelinux.org@mirrors.aliyun.com@g" /etc/apk/repositories \
# && go env -w GOPROXY=https://goproxy.cn,direct
RUN apk add --no-cache bash curl gcc git musl-dev
RUN go env -w GO111MODULE=on \
&& export PATH=$PATH:/go/bin \
&& go install -a -v github.com/go-bindata/go-bindata/...@latest \
&& go install -a -v github.com/elazarl/go-bindata-assetfs/...@latest \
&& go-bindata-assetfs -o=assets/bindata.go -pkg=assets assets/... \
&& go build -o sun-panel --ldflags="-X sun-panel/global.RUNCODE=release -X sun-panel/global.ISDOCKER=docker" main.go
# run_image
FROM alpine
WORKDIR /app
COPY --from=web_image /build/dist /app/web
COPY --from=server_image /build/sun-panel /app/sun-panel
# 中国国内源
# RUN sed -i "s@dl-cdn.alpinelinux.org@mirrors.aliyun.com@g" /etc/apk/repositories
EXPOSE 3002
RUN apk add --no-cache bash ca-certificates su-exec tzdata \
&& chmod +x ./sun-panel \
&& ./sun-panel -config
CMD ./sun-panel