chore: 初始化提交
This commit is contained in:
commit
943c0a0e5a
71 files changed
+7122
No files matched your search
@@ -0,0 +1,25 @@
|
||||
# 使用纯 Go 的 SQLite 驱动,构建时无需 CGO
|
||||
FROM golang:1.25-alpine AS build
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
COPY go.mod ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
RUN go mod tidy && CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/server ./cmd/server
|
||||
|
||||
FROM alpine:3.20
|
||||
|
||||
RUN apk add --no-cache ca-certificates tzdata wget
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=build /out/server /app/server
|
||||
|
||||
ENV CANVAS_ADDR=":8080" \
|
||||
CANVAS_DATA_DIR="/data"
|
||||
|
||||
VOLUME ["/data"]
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["/app/server"]
|
||||
Reference in new issue
Block a user