-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile
46 lines (35 loc) · 1.27 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
### Checkout UI, Lib and Examples and Build UI
FROM node:8.12
WORKDIR /slang/
# Clone examples, libs and ui
RUN git clone https://github.com/Bitspark/slang-examples.git examples && \
git clone https://github.com/Bitspark/slang-lib.git lib && \
git clone https://github.com/Bitspark/slang-ui.git ui
# Checkout latest lib release
RUN cd lib && \
git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
# Checkout and build latest UI release
RUN cd ui && \
git checkout $(git describe --tags `git rev-list --tags --max-count=1`) && \
npm install && \
./node_modules/@angular/cli/bin/ng build --base-href /app/ --prod --output-path=dist
### Build daemon
FROM golang:1.18
WORKDIR /go/src/slang
COPY . .
RUN go mod tidy && \
env GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o slangd ./cmd/slangd
### Gather UI, lib and daemon and run daemon
FROM alpine
LABEL maintainer="[email protected]"
LABEL version="1"
WORKDIR /root/slang/
RUN apk --no-cache add ca-certificates
ENV USER root
ENV SLANG_PATH "/root/slang/"
COPY --from=0 /slang/examples/examples blueprints/examples
COPY --from=0 /slang/shared/slang shared/slang/
COPY --from=0 /slang/ui/dist ui/
COPY --from=1 /go/src/slang/slangd .
EXPOSE 5149
ENTRYPOINT ["/root/slang/slangd", "--skip-checks"]