diff --git a/Dockerfile b/Dockerfile index 529c8db4..19cc9cd1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,22 @@ -# BUILDER +# === BUILDER === FROM golang:latest AS builder WORKDIR /go/src/app -COPY . . -RUN go get -d -v ./... +# Install dependencies +COPY go.mod go.sum ./ +RUN go mod download + +# Copy the source code +COPY . . RUN go build -o dalfox -# RUNNING -FROM debian:buster +# === RUNNER === +FROM debian:bookworm RUN mkdir /app + +# Copy the binary from the builder stage COPY --from=builder /go/src/app/dalfox /app/dalfox COPY --from=builder /go/src/app/samples /app/samples + WORKDIR /app/ CMD ["/app/dalfox"]