feat: add Docker deployment and application configuration

Add package declarations across the Go scaffold, YAML configuration loading and validation, and a minimal API entry point.

Add development and production Compose files, a multi-stage Docker image, configuration template, and Make targets. Remove the directory scaffolding script.
This commit is contained in:
2026-09-17 11:38:47 +03:30
parent 56ecf089c9
commit 0557635008
40 changed files with 217 additions and 126 deletions
+26
View File
@@ -0,0 +1,26 @@
FROM golang:1.27-alpine AS build
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build \
-trimpath \
-ldflags="-s -w" \
-o /out/robot-market-api \
./cmd/api
FROM alpine:3.22 AS production
RUN apk add --no-cache ca-certificates \
&& addgroup -S app \
&& adduser -S -G app app
COPY --from=build /out/robot-market-api /usr/local/bin/robot-market-api
USER app
EXPOSE 8080
ENTRYPOINT ["/usr/local/bin/robot-market-api"]