-
Notifications
You must be signed in to change notification settings - Fork 179
/
Dockerfile
44 lines (38 loc) · 1.08 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
# Prep base stage
ARG TF_VERSION=light
# Build ui
FROM node:20-alpine as ui
WORKDIR /src
# Copy specific package files
COPY ./ui/package-lock.json ./
COPY ./ui/package.json ./
COPY ./ui/babel.config.js ./
# Set Progress, Config and install
RUN npm set progress=false && npm config set depth 0 && npm install
# Copy source
# Copy Specific Directories
COPY ./ui/public ./public
COPY ./ui/src ./src
# build (to dist folder)
RUN NODE_OPTIONS='--openssl-legacy-provider' npm run build
# Build rover
FROM golang:1.21 AS rover
WORKDIR /src
# Copy full source
COPY . .
# Copy ui/dist from ui stage as it needs to embedded
COPY --from=ui ./src/dist ./ui/dist
# Build rover
RUN go get -d -v golang.org/x/net/html
RUN CGO_ENABLED=0 GOOS=linux go build -o rover .
# Release stage
FROM hashicorp/terraform:$TF_VERSION AS release
# Copy terraform binary to the rover's default terraform path
RUN cp /bin/terraform /usr/local/bin/terraform
# Copy rover binary
COPY --from=rover /src/rover /bin/rover
RUN chmod +x /bin/rover
# Install Google Chrome
RUN apk add chromium
WORKDIR /src
ENTRYPOINT [ "/bin/rover" ]