Skip to content

Commit

Permalink
feat: add new implements to dockerfile and increase ttl on valkey;
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinezAvellan committed Feb 27, 2025
1 parent d4b6b96 commit b1bfb12
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
11 changes: 4 additions & 7 deletions components/onboarding/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
FROM golang:1.23-alpine AS builder
FROM --platform=$BUILDPLATFORM golang:1.23-alpine AS builder

WORKDIR /onboarding-app

COPY go.mod go.sum ./

RUN go mod download

COPY . .

RUN CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o /app components/onboarding/cmd/app/main.go
ARG TARGETPLATFORM
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$(echo $TARGETPLATFORM | cut -d'/' -f2) go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o /app components/onboarding/cmd/app/main.go

FROM gcr.io/distroless/static-debian12
FROM --platform=$TARGETPLATFORM gcr.io/distroless/static-debian12

COPY --from=builder /app /app

# Copy the migrations directory.
COPY --from=builder /onboarding-app/components/onboarding/migrations /components/onboarding/migrations

EXPOSE 3000

ENTRYPOINT ["/app"]
11 changes: 4 additions & 7 deletions components/transaction/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
FROM golang:1.23-alpine AS builder
FROM --platform=$BUILDPLATFORM golang:1.23-alpine AS builder

WORKDIR /transaction-app

COPY go.mod go.sum ./

RUN go mod download

COPY . .

RUN CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o /app components/transaction/cmd/app/main.go
ARG TARGETPLATFORM
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$(echo $TARGETPLATFORM | cut -d'/' -f2) go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o /app components/transaction/cmd/app/main.go

FROM gcr.io/distroless/static-debian12
FROM --platform=$TARGETPLATFORM gcr.io/distroless/static-debian12

COPY --from=builder /app /app

# Copy the migrations directory.
COPY --from=builder /transaction-app/components/transaction/migrations /components/transaction/migrations

EXPOSE 3001

ENTRYPOINT ["/app"]
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func (rr *RedisConsumerRepository) LockBalanceRedis(ctx context.Context, key str
end
local function main()
local ttl = 300
local ttl = 3600
local key = KEYS[1]
local operation = ARGV[1]
Expand Down

0 comments on commit b1bfb12

Please sign in to comment.