Build locally not in docker

This commit is contained in:
vinchent 2024-08-28 11:10:57 +02:00
parent 624f8f46ba
commit caed30d2f6

View File

@ -1,21 +1,8 @@
# 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
COPY brokerApp /app
CMD ["/app/brokerApp"]