mirror of
https://github.com/lightningequipment/circuitbreaker.git
synced 2026-08-13 12:33:02 +02:00
36 lines
699 B
Docker
36 lines
699 B
Docker
### Build frontend
|
|
FROM node:15.4 as build_frontend
|
|
|
|
WORKDIR /react-app
|
|
|
|
COPY webui/package*.json .
|
|
|
|
RUN npm install
|
|
|
|
COPY webui .
|
|
|
|
RUN npm run build
|
|
|
|
### Build backend
|
|
FROM golang:1.18-alpine AS build_backend
|
|
|
|
ARG BUILD_VERSION
|
|
|
|
WORKDIR /src
|
|
|
|
COPY *.go go.mod go.sum ./
|
|
COPY circuitbreakerrpc circuitbreakerrpc/
|
|
COPY --from=build_frontend /webui-build/ webui-build/
|
|
|
|
RUN go install -ldflags "-X main.BuildVersion=$BUILD_VERSION"
|
|
|
|
### Build an Alpine image
|
|
FROM alpine:3.16 as alpine
|
|
|
|
# Update CA certs
|
|
RUN apk add --no-cache ca-certificates && rm -rf /var/cache/apk/*
|
|
|
|
# Copy over app binary
|
|
COPY --from=build_backend /go/bin/circuitbreaker /usr/bin/circuitbreaker
|
|
|
|
ENTRYPOINT [ "circuitbreaker" ]
|