Building a docker image for the Broker service

This commit is contained in:
2024-08-28 09:49:09 +02:00
parent 8056721dc2
commit 0dc982e38b
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,21 @@
# base go image
FROM golang:1.22-alpine as builder
RUN mkdir /app
COPY . /app
WORKDIR /app
RUN CGO_ENABLED=0 go build -o brokerApp ./cmd/api
RUN chmod +x /app/brokerApp
# build a tiny docker image
FROM alpine:latest
RUN mkdir /app
COPY --from=builder /app/brokerApp /app
CMD ["/app/brokerApp"]