init
This commit is contained in:
21
Dockerfile
Normal file
21
Dockerfile
Normal 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"]
|
Reference in New Issue
Block a user