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.

Revisions

  1. mikemackintosh created this gist Aug 4, 2021.
    26 changes: 26 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    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" ]