hackathon/Dockerfile.gw

17 lines
278 B
Docker

2022-04-28 23:31:09 +07:00
FROM golang:1.18-alpine AS build_base
WORKDIR /app
RUN apk add git
RUN apk add build-base
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN CGO_ENABLED=1 GOOS=linux go build -o gw ./cmd/gw
FROM alpine:3.9
COPY --from=build_base /app/gw /app/gw
CMD ["/app/gw"]