Skip to content

Commit

Permalink
fix: VCS build info should now be integrated
Browse files Browse the repository at this point in the history
  • Loading branch information
StealWonders committed Mar 4, 2024
1 parent a58a3f5 commit 9debbb0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,27 @@ RUN go install github.com/cosmtrek/air@latest

# Run the air command in the directory where our code will live
WORKDIR /opt/mensatt
RUN git config --global --add safe.directory /opt/mensatt

# Start air hot-reload server
CMD ["air"]

FROM base as built

WORKDIR /go/app/mensatt
WORKDIR /opt/mensatt
#RUN git config --global --add safe.directory /opt/mensatt

# Install required dependencies here for better cache utilization
COPY go.mod go.sum ./
RUN go mod download

# Copy the rest of the code and build the binary
COPY . .
RUN go build -o /tmp/mensatt ./cmd/mensatt/main.go
RUN go build -o ./build/mensatt ./cmd/mensatt

FROM alpine:3.19 as prod

COPY --from=built /tmp/mensatt /usr/bin/mensatt
COPY --from=built /opt/mensatt/build/mensatt /usr/bin/mensatt

USER nobody:nobody

Expand Down

0 comments on commit 9debbb0

Please sign in to comment.