forked from bashofmann/rancher-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
29 lines (26 loc) · 1 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
FROM node:16 as ui
WORKDIR /usr/src/app
COPY . /usr/src/app
WORKDIR /usr/src/app/ui
RUN npm install
WORKDIR /usr/src/app
RUN cp -f ui/semantic.theme.config ui/semantic/src/theme.config && \
mkdir -p ui/semantic/src/themes/app && \
cp -rf ui/semantic.theme/* ui/semantic/src/themes/app
WORKDIR /usr/src/app/ui/semantic
RUN npx gulp build
FROM golang:1.16-alpine as app
RUN apk add -U --no-cache build-base git
COPY . /go/src/app
WORKDIR /go/src/app
ENV GO111MODULE=on
RUN go build -a -v -tags 'netgo' -ldflags '-w -linkmode external -extldflags -static' -o rancher-demo .
FROM alpine:3
COPY static /static
COPY --from=ui /usr/src/app/ui/semantic/dist/semantic.min.css /static/dist/semantic.min.css
COPY --from=ui /usr/src/app/ui/semantic/dist/semantic.min.js /static/dist/semantic.min.js
COPY --from=ui /usr/src/app/ui/semantic/dist/themes/default/assets /static/dist/themes/default/
COPY --from=app /go/src/app/rancher-demo /bin/rancher-demo
COPY templates /templates
EXPOSE 8080
ENTRYPOINT ["/bin/rancher-demo"]