From 6ef2e5b3478ff6c54b6f04a67ec109d942b487fc Mon Sep 17 00:00:00 2001 From: Simon Ding Date: Sun, 28 Jul 2024 21:28:29 +0800 Subject: [PATCH] feat: offline support --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6e706e7..52e5dcf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ WORKDIR /app COPY ./ui/pubspec.yaml ./ui/pubspec.lock ./ RUN flutter pub get COPY ./ui/ ./ -RUN flutter build web +RUN flutter build web --no-web-resources-cdn # 打包依赖阶段使用golang作为基础镜像 FROM golang:1.22 as builder @@ -24,7 +24,7 @@ COPY --from=flutter /app/build/web ./ui/build/web/ # 指定OS等,并go build RUN CGO_ENABLED=1 go build -o polaris -ldflags="-X polaris/db.Version=$(git describe --tags --long)" ./cmd/ -FROM debian:12 +FROM debian:stable-slim ENV TZ="Asia/Shanghai" GIN_MODE=release WORKDIR /app @@ -35,4 +35,6 @@ COPY --from=builder /app/polaris . EXPOSE 8080 +USER 1000:1000 + ENTRYPOINT ["./polaris"] \ No newline at end of file