lab2 done
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
Khakimov Dmitrij
2026-10-06 22:38:28 +03:00
parent 47a3cd582d
commit 300ef7714e
74 changed files with 2785 additions and 112 deletions
+21
View File
@@ -1,7 +1,22 @@
FROM golang:1.26.4-alpine3.23@sha256:18b460dd17542c2ba43299a633cf6ebfc1115101509531471d7cfce1019af083 AS goose-builder
RUN GOBIN=/out CGO_ENABLED=0 go install \
-tags='no_clickhouse no_libsql no_mssql no_mysql no_sqlite3 no_vertica no_ydb no_spanner' \
github.com/pressly/goose/v3/cmd/goose@v3.27.1
FROM alpine:3.23@sha256:075c2c1a4068c1e251228ca2b0ea8b163f835ca5d66e758b93c7fc89b1995616 AS migrations
COPY --from=goose-builder /out/goose /usr/local/bin/goose
COPY migrations /migrations
COPY infra/migrate.sh /usr/local/bin/migrate
USER 10001:10001
ENTRYPOINT ["/usr/local/bin/migrate"]
CMD ["up"]
FROM golang:1.26.4-alpine3.23@sha256:18b460dd17542c2ba43299a633cf6ebfc1115101509531471d7cfce1019af083 AS builder
WORKDIR /src
RUN apk add --no-cache gcc musl-dev
COPY go.mod go.sum ./
RUN go mod download
@@ -9,12 +24,18 @@ COPY cmd ./cmd
COPY contracts ./contracts
COPY dto ./dto
COPY internal ./internal
COPY migrations ./migrations
RUN CGO_ENABLED=0 GOOS=linux go build \
-trimpath \
-ldflags="-s -w" \
-o /out/messenger ./cmd
FROM builder AS tests
COPY --from=goose-builder /out/goose /usr/local/bin/goose
ENV GOOSE_MIGRATION_DIR=/src/migrations
CMD ["go", "test", "-p=1", "-race", "-count=1", "-v", "./..."]
FROM alpine:3.23@sha256:075c2c1a4068c1e251228ca2b0ea8b163f835ca5d66e758b93c7fc89b1995616
RUN addgroup -S messenger \