2021-12-06 12:24:22 +00:00
|
|
|
# ---- Build UI----
|
|
|
|
FROM node:alpine AS node
|
|
|
|
WORKDIR /app
|
|
|
|
COPY ui .
|
|
|
|
RUN yarn install
|
|
|
|
RUN yarn run build
|
|
|
|
|
|
|
|
# ---- Build Go----
|
|
|
|
FROM golang:1.17-alpine AS golang
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=node /app/dist ui/dist
|
|
|
|
COPY . .
|
|
|
|
RUN apk update && apk add git
|
2018-01-26 05:10:38 +00:00
|
|
|
RUN CGO_ENABLED=0 go build -ldflags "-s -w"
|
2017-09-26 12:50:09 +00:00
|
|
|
|
2021-12-06 12:24:22 +00:00
|
|
|
# ---- Release ----
|
|
|
|
FROM alpine
|
2018-04-16 10:49:33 +00:00
|
|
|
LABEL maintainer="cuigh <noname@live.com>"
|
2017-09-26 12:50:09 +00:00
|
|
|
WORKDIR /app
|
2018-06-25 11:03:18 +00:00
|
|
|
RUN apk add --no-cache ca-certificates
|
2021-12-06 12:24:22 +00:00
|
|
|
COPY --from=golang /app/swirl .
|
|
|
|
COPY --from=golang /app/config config/
|
2017-09-26 12:50:09 +00:00
|
|
|
EXPOSE 8001
|
2021-12-06 12:24:22 +00:00
|
|
|
ENTRYPOINT ["/app/swirl"]
|