-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
57 lines (37 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
57
################################################
# Build the frontend
################################################
FROM node:14.11.0-alpine as frontend_builder
WORKDIR /app
# install and cache app dependencies
COPY web/package.json ./
COPY web/yarn.lock ./
RUN yarn install --frozen-lockfile
# bundle app source inside Docker image
COPY web/. .
RUN yarn run build
FROM golang:1.16-alpine AS server_builder
WORKDIR /app
COPY go.* ./
# install dependencies
RUN go mod download
# copy built frontend static files
COPY --from=frontend_builder ./app/build ./web/build
ARG VERSION
# add all other folders required for the Go build
COPY . .
COPY web/build.go web/build.go
RUN go build -ldflags "-X commands.version=$VERSION" -o bin/iamzero-all-in-one cmd/all-in-one/main.go
FROM alpine:3.13.5
WORKDIR /app
COPY --from=server_builder /app/bin/iamzero-all-in-one /app/iamzero-all-in-one
# set HTTP ingress port
ENV IAMZERO_COLLECTOR_HOST=0.0.0.0:13991
ENV IAMZERO_CONSOLE_HOST=0.0.0.0:14321
# Web HTTP
EXPOSE 14321
# Collector HTTP
EXPOSE 13991
# Healthcheck
EXPOSE 10866
CMD /app/iamzero-all-in-one