-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (22 loc) · 735 Bytes
/
Copy pathDockerfile
File metadata and controls
31 lines (22 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Use a specific version of Go for building the application
FROM golang:1.23.0-alpine AS build
# Labels for the image
LABEL Created="Tharun G" \
Maintainer="TharunDevops1@outlook.com"
# Set the working directory
WORKDIR /defectdojo
# Copy go.mod and go.sum files first to leverage Docker cache
COPY go.mod go.sum ./
# Download dependencies
RUN go mod download
# Copy the rest of the application code
COPY main.go ./
# CMD ["go","run","main.go"]
# Build the application
RUN go build -o app main.go
# Create a new image using a distroless base
FROM gcr.io/distroless/static-debian12
# Copy the built application from the build stage
COPY --from=build /defectdojo/app /
# Set the command to run the application
CMD ["/app"]