This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
FROM golang:1.21-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Set Go Proxy if needed
|
||||
# RUN go env -w GOPROXY=https://goproxy.cn,direct
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
RUN go build -o main .
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /app/main .
|
||||
COPY --from=builder /app/config.yaml .
|
||||
COPY --from=builder /app/db/ ./db/
|
||||
|
||||
# Create source directory for file uploads
|
||||
RUN mkdir -p /app/source
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
CMD ["./main"]
|
||||
Reference in New Issue
Block a user