Skip to content

Commit

Permalink
Reduced even further the size of the search engine image
Browse files Browse the repository at this point in the history
  • Loading branch information
akosma committed Dec 13, 2019
1 parent da3c5bf commit 4d1fdff
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,24 @@ COPY . /app
RUN npm run build


# Step 2: Create the runtime image
FROM node:10.15.3-alpine
# Step 2: Install only production libraries
FROM node:10.15.3-alpine AS installer

WORKDIR /site
WORKDIR /app
COPY ["package.json", "package-lock.json", "./"]
RUN npm install --production


# Step 3: Create the runtime image
FROM astefanutti/scratch-node:10.15.3

WORKDIR /site
COPY index /site/index
COPY --from=installer /app/node_modules /site/node_modules
COPY --from=builder /app/dist /site/dist
EXPOSE 3000

# Don't run as root even in plain docker
USER 1001:0

CMD npm start
ENTRYPOINT ["node", "dist/index.js"]

0 comments on commit 4d1fdff

Please sign in to comment.