From 2713766cd8531e703d17229e5461c5e5ee33b393 Mon Sep 17 00:00:00 2001 From: "Gustavo \"Guz\" L de Mello" Date: Fri, 9 Jan 2026 16:09:41 -0300 Subject: [PATCH] chore(oci): minimal dockerimage setup --- Dockerfile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..910942e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM golang:1.25.5-alpine3.23@sha256:6cc2338c038bc20f96ab32848da2b5c0641bb9bb5363f2c33e9b7c8838f9a208 AS build + +WORKDIR /app + +# Retrieve dependencies. Making this a separated step makes +# Docker be able to reuse cached dependencies +COPY go.* ./ +RUN go mod download + +# Copy local code +COPY . ./ + +# Build the binary +RUN go build -v -o depgraph + +# Use standard alpine to run the application to +# have a lean production container +FROM debian:trixie-slim@sha256:4bcb9db66237237d03b55b969271728dd3d955eaaa254b9db8a3db94550b1885 +RUN set -x && apt-get update && DEBIAN_FRONTEND=nointeractive apt-get install -y \ + ca-certificates && \ + rm -rf /var/lib/apt/lists/* + +# Copy binary from build step to production image +COPY --from=build /app/depgraph /app/depgraph + +# Run the application +CMD ["/app/depgraph"]