22 lines
290 B
Docker
22 lines
290 B
Docker
FROM golang:1.23.6 AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY go.mod .
|
|
|
|
RUN go mod tidy
|
|
|
|
COPY . .
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o server main.go
|
|
|
|
FROM alpine:latest
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /app/server /app/server
|
|
|
|
RUN chmod +x /app/server
|
|
|
|
ENTRYPOINT ["/app/server"]
|