Everything below is one project, built from an ordinary repository with no
Gagarin-specific anything in it. No manifest, no config file, no YAML: there is
nowhere on this platform to put one, which is the point and is also why this post
is short.
The app is a Go API, a web front end that calls it, and a Postgres under both.
Call the project feed .
1. The Dockerfile is the only file we need
If your repository already builds an image, you are done before you start. Ours
is the usual two-stage build:
FROM golang:1.25-alpine AS build WORKDIR /src COPY go.mod go.sum ./ RUN go mod download COPY . . RUN CGO_ENABLED = 0 go build -o /out/feed ./cmd/feed
FROM gcr.io/distroless/static:nonroot COPY --from=build /out/feed /feed EXPOSE 8080 USER nonroot ENTRYPOINT ["/feed"]
Enter fullscreen mode
Exit fullscreen mode
Two things about it matter here and nothing else does. It listens on one TCP
port , and it reads its configuration from the environment.…