-
Notifications
You must be signed in to change notification settings - Fork 43
/
Dockerfile.agent
27 lines (20 loc) · 812 Bytes
/
Dockerfile.agent
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
ARG GO_VERSION=1.21
FROM golang:${GO_VERSION} AS builder
WORKDIR /build
COPY . .
# Install contrast-go
RUN go run github.com/contrast-security-oss/contrast-go-installer@latest latest
# Build the app with contrast-go
ARG FRAMEWORK=std
RUN CGO_ENABLED=0 contrast-go build -o go-test-bench ./cmd/${FRAMEWORK}
# Move the finished build to a more minimal container
FROM alpine:latest
COPY --from=builder /build/views ./views
COPY --from=builder /build/public ./public
COPY --from=builder /build/go-test-bench ./go-test-bench
# Copy over the Contrast configuration file. All configuration can be done with
# environment variables as well. See our docs for more details:
#
# https://docs.contrastsecurity.com/en/go-configuration.html
COPY ./contrast_security.yaml .
ENTRYPOINT ["./go-test-bench", "-addr=:8080"]