feat: ci/cd

This commit is contained in:
Giovanni Rezcjikov
2026-03-09 12:50:29 +03:00
parent f4e4fb21e3
commit daaa702dad
21 changed files with 585 additions and 267 deletions
+30
View File
@@ -0,0 +1,30 @@
FROM golang:1.23-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build \
-trimpath \
-ldflags="-s -w" \
-o /app/server \
./cmd/server
FROM alpine:3.20
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /app
COPY --from=builder /app/server .
COPY --from=builder /app/migrations ./migrations
RUN addgroup -S app && adduser -S app -G app
USER app
EXPOSE 8080
CMD ["./server"]