2022-01-26 10:35:47 +00:00
|
|
|
ARG GO_VERSION=1.17
|
|
|
|
ARG NODE_VERSION=16.13
|
|
|
|
ARG ALPINE_VERSION=3.15
|
2020-09-24 20:28:37 +00:00
|
|
|
|
|
|
|
FROM node:${NODE_VERSION}-alpine AS node-builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY admin/package.json admin/yarn.lock ./
|
|
|
|
RUN yarn install --frozen-lockfile
|
|
|
|
COPY admin/ .
|
|
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
|
|
RUN yarn run export
|
|
|
|
|
2021-04-26 07:24:45 +00:00
|
|
|
FROM golang:${GO_VERSION}-alpine AS go-builder
|
2022-01-26 10:35:47 +00:00
|
|
|
ARG HETTY_VERSION=0.0.0
|
|
|
|
ENV CGO_ENABLED=0
|
2021-04-26 07:24:45 +00:00
|
|
|
WORKDIR /app
|
|
|
|
COPY go.mod go.sum ./
|
|
|
|
RUN go mod download
|
|
|
|
COPY cmd ./cmd
|
|
|
|
COPY pkg ./pkg
|
|
|
|
COPY --from=node-builder /app/dist ./cmd/hetty/admin
|
2022-01-26 10:35:47 +00:00
|
|
|
RUN go build -ldflags="-s -w -X main.version=${HETTY_VERSION}" ./cmd/hetty
|
2021-04-26 07:24:45 +00:00
|
|
|
|
|
|
|
FROM alpine:${ALPINE_VERSION}
|
2020-09-24 20:28:37 +00:00
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=go-builder /app/hetty .
|
|
|
|
|
2021-04-26 07:24:45 +00:00
|
|
|
ENTRYPOINT ["./hetty"]
|
2020-09-24 20:28:37 +00:00
|
|
|
|
2020-09-28 18:41:43 +00:00
|
|
|
EXPOSE 8080
|