27 lines
368 B
Docker
27 lines
368 B
Docker
|
# Author:Mateusz Kędziora https://mkedziora.pl
|
||
|
|
||
|
FROM golang:1.23.2-alpine AS builder
|
||
|
|
||
|
WORKDIR /app
|
||
|
|
||
|
COPY go.mod go.sum* ./
|
||
|
|
||
|
RUN go mod download
|
||
|
|
||
|
COPY *.go ./
|
||
|
|
||
|
RUN CGO_ENABLED=0 GOOS=linux go build -o main .
|
||
|
|
||
|
FROM alpine:latest
|
||
|
|
||
|
RUN apk --no-cache add ca-certificates
|
||
|
|
||
|
WORKDIR /root/
|
||
|
|
||
|
COPY --from=builder /app/main .
|
||
|
|
||
|
COPY public/ ./public
|
||
|
|
||
|
EXPOSE 8000
|
||
|
|
||
|
CMD ["./main"]
|