Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9fbeddc9f4 | |||
| 289bbe3f0d | |||
| bec6a93b65 | |||
| e2a41fc187 | |||
| c7a04f3857 | |||
| 9c5398071c | |||
| 1f6400ba5d |
+7
-1
@@ -1,4 +1,5 @@
|
||||
FROM golang:alpine AS backend-builder
|
||||
RUN apk add --no-cache build-base
|
||||
WORKDIR /build
|
||||
COPY . .
|
||||
ENV CGO_ENABLED=1
|
||||
@@ -8,7 +9,12 @@ RUN apk add --no-cache upx
|
||||
|
||||
RUN upx --best --lzma bin/server
|
||||
|
||||
FROM alpine:latest
|
||||
# 使用更小的 Debian
|
||||
FROM debian:bookworm-slim
|
||||
# 安装最小运行时依赖
|
||||
RUN apt-get update && apt-get install -y \
|
||||
ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
COPY --from=backend-builder /build/bin/server /app/server
|
||||
COPY static /app/static
|
||||
COPY static/*.so /app/
|
||||
|
||||
Reference in New Issue
Block a user