This commit is contained in:
michelia
2023-07-06 11:25:49 +08:00
commit 5ba8dfdbdd
5 changed files with 195 additions and 0 deletions

21
Dockerfile Normal file
View File

@ -0,0 +1,21 @@
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"]