File tree 2 files changed +20
-10
lines changed
2 files changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -102,3 +102,7 @@ venv.bak/
102
102
103
103
# mypy
104
104
.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
3
3
4
4
# Set the working directory
5
5
WORKDIR /app
6
6
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
9
9
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
15
12
16
13
# Build the application
17
14
RUN go build -o main .
18
15
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
+
20
26
ENTRYPOINT ["/app/main" ]
You can’t perform that action at this time.
0 commit comments