-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(dockerfile): adding build and staging stages (#69)
- Loading branch information
Showing
1 changed file
with
12 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
FROM golang:1.23.0-alpine3.19 as builder | ||
|
||
# Set necessary environment variables for the Go proxy | ||
# ENV GO111MODULE=on | ||
# ENV GOPROXY=https://goproxy.io,direct | ||
# Build | ||
FROM golang:1.23.0-alpine3.19 AS builder | ||
|
||
WORKDIR /app | ||
|
||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
RUN go build -o wrapto . | ||
|
||
# Staging | ||
FROM alpine:3.19 | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /app/wrapto . | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["./wrapto"] |