Skip to content

Instantly share code, notes, and snippets.

@mikemackintosh
Created August 4, 2021 06:47
Show Gist options
  • Save mikemackintosh/52dba09d44c20f87ea4fe9177ff99b0a to your computer and use it in GitHub Desktop.
Save mikemackintosh/52dba09d44c20f87ea4fe9177ff99b0a to your computer and use it in GitHub Desktop.
FROM node:16-alpine3.11 as build-node
RUN apk --no-cache --virtual build-dependencies add \
python \
make \
g++
WORKDIR /workdir
COPY web/ .
RUN yarn install
RUN yarn build
FROM golang:1.17rc2-alpine3.14 as build-go
ENV GOPATH ""
RUN go env -w GOPROXY=direct
RUN apk add git
ADD go.mod go.sum ./
RUN go mod download
ADD . .
COPY --from=build-node /workdir/build ./web/build
RUN go build -o /main
FROM alpine:3.13
COPY --from=build-go /main /main
ENTRYPOINT [ "/main" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment