-
Notifications
You must be signed in to change notification settings - Fork 103
/
Dockerfile
52 lines (35 loc) · 1.35 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
# stage 1 ui
FROM node:20-alpine as ui
COPY ./web/abstruse ./app/ui
WORKDIR /app/ui
RUN npm install && npm run build
# stage 2 build
FROM golang:1.21-alpine as build
ARG GIT_COMMIT=""
ENV GIT_COMMIT=$GIT_COMMIT
WORKDIR /app
RUN apk --no-cache add git make protobuf protobuf-dev ca-certificates alpine-sdk
COPY --from=ui /app/ui/dist /app/web/abstruse/dist
COPY . /app/
RUN go get google.golang.org/protobuf/cmd/protoc-gen-go \
github.com/jkuri/statik \
github.com/google/wire/cmd/[email protected] \
google.golang.org/grpc/cmd/protoc-gen-go-grpc
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go \
github.com/jkuri/statik \
github.com/google/wire/... \
google.golang.org/grpc/cmd/protoc-gen-go-grpc
RUN make protoc && make statik && make wire && make server
# stage 3 image
FROM alpine:latest
LABEL maintainer="Jan Kuri <[email protected]>" \
org.label-schema.schema-version="1.0" \
org.label-schema.name="abstruse-server" \
org.label-schema.description="Distributed Continuous Intergration Platform" \
org.label-schema.url="https://ci.abstruse.app/" \
org.label-schema.vcs-url="https://github.com/bleenco/abstruse" \
org.label-schema.vendor="abstruse"
COPY --from=build /etc/ssl/certs /etc/ssl/certs
COPY --from=build /app/build/abstruse-server /usr/bin/abstruse-server
ENTRYPOINT [ "/usr/bin/abstruse-server" ]
EXPOSE 80