Skip to content

Commit

Permalink
feat(dockerfile): uses node alpine and fixes build needing tools
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Angelo <[email protected]>
  • Loading branch information
angeloanan committed Jun 7, 2020
1 parent f1f5a3e commit d834011
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
# Build stage
FROM node:14 AS build
FROM node:14-alpine AS build
WORKDIR /usr/app
COPY package*.json ./
RUN yarn install
# Install build-essentials - https://github.com/mhart/alpine-node/issues/27#issuecomment-390187978
RUN apk add --no-cache --virtual .build-deps alpine-sdk python \
&& yarn install \
&& apk del .build-deps
COPY . .
RUN yarn build

# App stage
FROM node:14 as app
FROM node:14-alpine as app
WORKDIR /usr/app
COPY package*.json ./
ENV NODE_ENV=production
RUN yarn install --production
# Install build-essentials - https://github.com/mhart/alpine-node/issues/27#issuecomment-390187978
RUN apk add --no-cache --virtual .build-deps alpine-sdk python \
&& yarn install --production \
&& apk del .build-deps

COPY --from=build /usr/app/target ./
VOLUME /usr/app/img
Expand Down

0 comments on commit d834011

Please sign in to comment.