Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
Improve dockerfile build speeds (#416)
Browse files Browse the repository at this point in the history
1. Use alpine for build. This benefit is two-fold: 1) only pull one image 2) alpine is much smaller than full node images, so it pulls much faster
2. Remove `apk update `steps in favor of `--no-cache`, speeding up the build since we don't need a full `apk update` + we don't need the step to manually remove the cache anymore.
  • Loading branch information
dotLou authored and wennmo committed Jan 30, 2019
1 parent ad888da commit 1cae357
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
@@ -1,5 +1,5 @@
# Do the npm install on the full image
FROM node:8.15.0 AS builder
FROM node:8.15.0-alpine AS builder

WORKDIR /app
COPY package*.json ./
Expand All @@ -17,7 +17,7 @@ WORKDIR /app
COPY --from=builder /app .
RUN chmod +x ./docker-entrypoint.sh

RUN apk update && apk add bash && apk add curl && rm -rf /var/cache/apk/*
RUN apk add --no-cache bash curl

# check every 30s to ensure this service returns HTTP 200
HEALTHCHECK CMD curl -fs http://localhost:$MIRA_API_PORT/health || exit 1
Expand Down

0 comments on commit 1cae357

Please sign in to comment.