Skip to content

Commit

Permalink
adds build args to the right image
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronschweig committed Mar 18, 2021
1 parent ab0d946 commit cf6e287
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@ FROM node:latest as build

WORKDIR /app

COPY *.json ./
COPY yarn.lock .
RUN yarn install --link-duplicates --ignore-optional


COPY ./ ./
RUN yarn build
RUN yarn install --production --link-duplicates --ignore-optional


FROM node:alpine as prod
EXPOSE 3000

ARG MONGO_CONNECTION_ARG
ARG JWT_SECRET_ARG
ARG REDIS_HOST_ARG
Expand All @@ -18,18 +31,6 @@ ENV REDIS_USER=$REDIS_USER_ARG
ENV REDIS_PW=$REDIS_PW_ARG
ENV REDIS_DB=$REDIS_DB_ARG

COPY *.json ./
COPY yarn.lock .
RUN yarn install --link-duplicates --ignore-optional


COPY ./ ./
RUN yarn build
RUN yarn install --production --link-duplicates --ignore-optional


FROM node:alpine as prod
EXPOSE 3000
WORKDIR /app
USER node
ENV NODE_ENV production
Expand Down

0 comments on commit cf6e287

Please sign in to comment.