Skip to content

Commit

Permalink
Dockerfile optimized
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanProgramming authored Sep 6, 2022
1 parent d0bafe4 commit 95f7fa5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM golang:latest as builder
WORKDIR /app
COPY . .
# Copying go.mod to reduce docker container build time (by using cache)
COPY go.mod /app/go.mod
RUN go mod download && go mod verify
COPY . .
RUN go build -o /app/app
FROM alpine:latest
WORKDIR /app
Expand Down

0 comments on commit 95f7fa5

Please sign in to comment.