Add incremental dockerfiles
This commit is contained in:
@ -0,0 +1,17 @@
|
||||
# Pin specific version for stability
|
||||
# Use alpine for reduced image size
|
||||
FROM golang:1.19-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy only files required to install dependencies (better layer caching)
|
||||
COPY go.mod go.sum ./
|
||||
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
# Compile application during build rather than at runtime
|
||||
RUN go build -o api-golang
|
||||
|
||||
CMD ["./api-golang"]
|
||||
Reference in New Issue
Block a user