Skip to content

Commit

Permalink
Cleaned Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
im2nguyen committed Oct 2, 2021
1 parent 5308517 commit c9ecb0f
Showing 1 changed file with 9 additions and 19 deletions.
28 changes: 9 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@ ARG TF_VERSION=light
# Build ui
FROM node:16-alpine as ui
WORKDIR /src
# Copy all package*.json files
# COPY ./ui/package*.json ./
# Copy specific package files
COPY ./ui/package-lock.json ./
COPY ./ui/package.json ./
# Set Progress, Config and install
RUN npm set progress=false && npm config set depth 0 && npm install
# Copy source
# Copy Full Directory
# COPY ./ui .
# Copy Specific Directories
COPY ./ui/public ./public
COPY ./ui/src ./src
Expand All @@ -23,28 +19,22 @@ RUN npm run build
# Build rover
FROM golang:1.17 AS rover
WORKDIR /src
# copy full source
# COPY . .
# copy go sources
COPY ./go.mod .
COPY ./go.sum .
COPY ./graph.go .
COPY ./main.go .
COPY ./map.go .
COPY ./rso.go .
COPY ./server.go .
COPY ./zip.go .
# copy ui/dist from ui stage as it needs to embedded
# Copy full source
COPY . .
# Copy ui/dist from ui stage as it needs to embedded
COPY --from=ui ./src/dist ./ui/dist
# build rover
# 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
# Copy terraform binary to the rover's default terraform path
RUN cp /bin/terraform /usr/local/bin/terraform
# copy rover binary
# Copy rover binary
COPY --from=rover /src/rover /bin/rover
RUN chmod +x /bin/rover

WORKDIR /src

ENTRYPOINT [ "/bin/rover" ]

0 comments on commit c9ecb0f

Please sign in to comment.