summaryrefslogtreecommitdiff
blob: 9a13fa3916cfeb23f4986d7c997d8ee37de6ffcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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"]