FROM golang:1.26 WORKDIR /app RUN apt install -y make gcc # Make sure /app is safe regardless of who owns it RUN git config --global --add safe.directory /app ENV CGO_ENABLED=1 # Install Air for auto-reloading RUN go install github.com/air-verse/air@latest # Copy dependency definitions first (caching optimization) COPY go.mod go.sum ./ RUN go mod download COPY . . RUN make build BUILD_DIR=/tmp