Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions apps/jan-api-gateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
FROM golang:1.24.6-alpine AS builder
WORKDIR /app

RUN apk add --no-cache build-base

COPY application/go.mod ./
RUN go mod download

ARG VERSION_TAG=dev
COPY application/. .
RUN go mod tidy
RUN go build -o /jan-api-gateway \
-gcflags="all=-N -l" \
-ldflags="-X menlo.ai/jan-api-gateway/config.Version=${VERSION_TAG}" \
./cmd/server

RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 \
go build -o /jan-api-gateway \
-gcflags="all=-N -l" \
-ldflags="-linkmode=external -X menlo.ai/jan-api-gateway/config.Version=${VERSION_TAG}" \
./cmd/server

FROM alpine:latest
WORKDIR /root/
COPY --from=builder /jan-api-gateway .

EXPOSE 8080
CMD ["./jan-api-gateway"]
CMD ["./jan-api-gateway"]
Loading