lab5 done
This commit is contained in:
+8
-1
@@ -1,5 +1,5 @@
|
||||
FROM golang:1.26.4-alpine3.23@sha256:18b460dd17542c2ba43299a633cf6ebfc1115101509531471d7cfce1019af083 AS goose-builder
|
||||
RUN GOBIN=/out CGO_ENABLED=0 go install \
|
||||
RUN GOMAXPROCS=2 GOFLAGS=-p=1 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
|
||||
|
||||
@@ -25,6 +25,7 @@ COPY contracts ./contracts
|
||||
COPY dto ./dto
|
||||
COPY internal ./internal
|
||||
COPY migrations ./migrations
|
||||
ENV GOFLAGS=-p=1 GOMAXPROCS=2
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build \
|
||||
-trimpath \
|
||||
@@ -32,6 +33,8 @@ RUN CGO_ENABLED=0 GOOS=linux go build \
|
||||
-o /out/messenger ./cmd
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/reconcile ./cmd/reconcile
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/worker ./cmd/worker
|
||||
|
||||
FROM builder AS tests
|
||||
COPY --from=goose-builder /out/goose /usr/local/bin/goose
|
||||
ENV GOOSE_MIGRATION_DIR=/src/migrations
|
||||
@@ -39,6 +42,8 @@ CMD ["go", "test", "-p=1", "-race", "-count=1", "-v", "./..."]
|
||||
|
||||
FROM alpine:3.23@sha256:075c2c1a4068c1e251228ca2b0ea8b163f835ca5d66e758b93c7fc89b1995616
|
||||
|
||||
RUN apk add --no-cache libwebp-tools=1.6.0-r0
|
||||
|
||||
RUN addgroup -S messenger \
|
||||
&& adduser -S -D -H -u 10001 -G messenger messenger
|
||||
|
||||
@@ -46,6 +51,8 @@ COPY --from=builder --chown=messenger:messenger /out/messenger /usr/local/bin/me
|
||||
|
||||
COPY --from=builder --chown=messenger:messenger /out/reconcile /usr/local/bin/reconcile
|
||||
|
||||
COPY --from=builder --chown=messenger:messenger /out/worker /usr/local/bin/worker
|
||||
|
||||
ENV PORT=8080
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
Reference in New Issue
Block a user