2023-07-07 16:11:20 +08:00

21 lines
346 B
Docker

FROM golang:1.19
# Set destination for COPY
WORKDIR /app
# Download Go modules
COPY go.mod go.sum ./
RUN go mod download
# Copy the source code. Note the slash at the end, as explained in
# https://docs.docker.com/engine/reference/builder/#copy
COPY *.go ./
# Build
RUN CGO_ENABLED=0 go build -o /web
# Expose
EXPOSE 8081
# Run
CMD ["/web"]