Implement lab2 messenger API with PostgreSQL Redis and Docker

This commit is contained in:
Fedoroff
2026-10-13 21:12:44 +03:00
parent 65003b6119
commit c251f2cb7d
34 changed files with 2783 additions and 20 deletions
+32
View File
@@ -0,0 +1,32 @@
FROM golang:1.25.0-alpine3.22 AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY cmd ./cmd
COPY internal ./internal
COPY migrations ./migrations
RUN CGO_ENABLED=0 GOOS=linux go build \
-trimpath \
-ldflags="-s -w" \
-o /server ./cmd/server
FROM alpine:3.22.1
RUN apk add --no-cache ca-certificates \
&& addgroup -S app \
&& adduser -S -G app app
WORKDIR /app
COPY --from=builder /server /app/server
USER app
EXPOSE 8080
CMD ["/app/server"]