Add Docker support and GitHub Actions workflow

This commit is contained in:
2026-04-27 10:38:22 +08:00
parent c6154273f2
commit 2caef17124
6 changed files with 159 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
FROM golang:1.21-alpine AS builder
WORKDIR /app
RUN apk add --no-cache git
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o /app/server ./cmd/server
FROM alpine:latest
WORKDIR /app
RUN apk add --no-cache ca-certificates tzdata
COPY --from=builder /app/server .
COPY --from=builder /app/uploads ./uploads
EXPOSE 8080
CMD ["./server"]