File tree Expand file tree Collapse file tree 2 files changed +20
-10
lines changed
Expand file tree Collapse file tree 2 files changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -102,3 +102,7 @@ venv.bak/
102102
103103# mypy
104104.mypy_cache /
105+
106+ # IDEs
107+ .idea /
108+ .vscode /
Original file line number Diff line number Diff line change 1- # Use the official Golang image as the base image
2- FROM golang:1.16 -alpine
1+ # Use the official Golang image as the base image - https://hub.docker.com/_/golang/tags
2+ FROM golang:1.20 -alpine as builder
33
44# Set the working directory
55WORKDIR /app
66
7- # Copy go.mod and go.sum files to the container
8- COPY go.mod go.sum ./
7+ # Copy source to this builder container
8+ COPY . /app
99
10- # Download dependencies
11- RUN go mod download
12-
13- # Copy the source code to the container
14- COPY . .
10+ # Download build dependencies
11+ RUN go get github.com/codingo/dorky
1512
1613# Build the application
1714RUN go build -o main .
1815
19- # Set the entrypoint for the container
16+ # Bump the application with --help to know it was built
17+ RUN /app/main --help
18+
19+
20+ # Use an Alpine container to deploy/run the application from - https://hub.docker.com/_/alpine/tags
21+ FROM alpine:3.18
22+
23+ WORKDIR /app
24+ COPY --from=builder /app/main /app/main
25+
2026ENTRYPOINT ["/app/main" ]
You can’t perform that action at this time.
0 commit comments