diff options
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9a13fa3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM golang:1.14.0 AS builder +WORKDIR /go/src/glsamaker +COPY . /go/src/glsamaker +RUN go get github.com/go-pg/pg/v9 +RUN go get github.com/google/uuid +RUN go get github.com/skip2/go-qrcode +RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o bin . + +FROM node:13 AS assetsbuilder +WORKDIR /go/src/glsamaker +COPY . /go/src/glsamaker +RUN npm install && cd node_modules/@gentoo/tyrian && npm install && npm run dist && cd /go/src/glsamaker +RUN npx webpack + +FROM alpine:latest as certs +RUN apk --update add ca-certificates + +FROM scratch +WORKDIR /go/src/glsamaker +COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt +COPY --from=assetsbuilder /go/src/glsamaker/assets /go/src/glsamaker/assets +COPY --from=builder /go/src/glsamaker/bin /go/src/glsamaker/bin +COPY --from=builder /go/src/glsamaker/pkg /go/src/glsamaker/pkg +COPY --from=builder /go/src/glsamaker/web /go/src/glsamaker/web + +CMD ["/go/src/glsamaker/bin/glsamaker"] |