-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathDockerfile
56 lines (36 loc) · 1.09 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Stage - frontend
# TODO: remove version pin when they fix the regression https://github.com/nodejs/node/pull/49500
FROM node:20.5 as frontend
WORKDIR /build
COPY ./pkg/frontend ./pkg/frontend
WORKDIR /build/pkg/frontend
RUN npm i && npm run build
# Stage - builder
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang as builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETOS
ARG TARGETARCH
ENV GOOS=${TARGETOS:-linux}
ENV GOARCH=${TARGETARCH:-amd64}
ENV CGO_ENABLED=0
WORKDIR /build
COPY --from=frontend /build/pkg/frontend/dist /build/pkg/frontend/dist
COPY go.mod ./
COPY go.sum ./
COPY main.go ./
RUN go mod download
ARG VER=0.0.0
ENV VERSION=${VER}
ADD Makefile ./
ADD ./pkg/backend ./pkg/backend
ADD ./pkg/frontend/fs.go ./pkg/frontend
RUN make build_go
# Stage - runner
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine
ARG TARGETPLATFORM
ARG BUILDPLATFORM
EXPOSE 8090
COPY --from=builder /build/bin/komoplane /bin/komoplane
ENTRYPOINT ["/bin/komoplane", "--bind=0.0.0.0", "--port=8090"]
# docker build . -t komodorio/komoplane:0.0.0 && kind load docker-image komodorio/komoplane:0.0.0