You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

35 lines
759 B

FROM node as frontend
COPY ./ui/package.json ./ui/yarn.lock /src/
RUN yarn install
COPY ./ui/ .
RUN yarn build
FROM golang:1.15-alpine as backend
RUN apk add --no-cache git gcc musl-dev
RUN go get
RUN go get
COPY go.mod go.sum /src/
RUN go mod download
COPY . .
COPY --from=frontend /src/dist ./ui/dist
RUN go generate
RUN VERSION=$(git describe --tags --abbrev=0)-$(git rev-parse --short HEAD) && \
go build \
-ldflags="-w -X '${VERSION}' -linkmode external -extldflags '-static'" \
-o /calendar main.go
FROM scratch as release
COPY --from=backend /calendar .
CMD ["/calendar"]