You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
637 B
Docker
26 lines
637 B
Docker
4 years ago
|
FROM node:14.14.0-alpine3.10 AS builder
|
||
|
WORKDIR /
|
||
|
COPY package.json package-lock.json ./
|
||
|
RUN npm install && mkdir frontend
|
||
|
RUN mv node_modules ./frontend
|
||
|
WORKDIR /frontend
|
||
|
COPY . .
|
||
|
|
||
|
RUN npm run ng build --prod --crossOrigin=anonymous
|
||
|
|
||
|
FROM golang:1.13.4-alpine as builder2
|
||
|
RUN apk add git
|
||
|
WORKDIR /
|
||
|
COPY --from=builder /frontend/dist /dist
|
||
|
RUN go get github.com/rakyll/statik
|
||
|
RUN statik --src=/dist/flotte-frontend
|
||
|
COPY *.go *.sum *.mod /
|
||
|
COPY vendor ./vendor
|
||
|
RUN CGO_ENABLED=0 GOOS=linux go build --mod=vendor -o frontend_server
|
||
|
|
||
|
FROM scratch
|
||
|
WORKDIR /
|
||
|
COPY --from=builder2 frontend_server .
|
||
|
EXPOSE 8080
|
||
|
ENTRYPOINT ["/frontend_server"]
|