Skip to content

Commit

Permalink
make the docker container smaller
Browse files Browse the repository at this point in the history
  • Loading branch information
ngn13 committed Apr 13, 2024
1 parent a43ce03 commit cd05aa3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21.4
FROM golang:1.21.4 as build

WORKDIR /app

Expand All @@ -10,6 +10,11 @@ COPY static ./static
COPY views ./views
COPY routes ./routes

RUN go build .
EXPOSE 8080
RUN CGO_ENABLED=0 go build .

FROM alpine as main
COPY --from=build /app /app

WORKDIR /app
ENTRYPOINT ["/app/note-server"]

0 comments on commit cd05aa3

Please sign in to comment.