Skip to content

Commit

Permalink
perf(dockerfile.prod): made the image smaller by using --production flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Simen Daehlin committed Dec 30, 2022
1 parent 4af2a65 commit bdef39c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions templates/Dockerfile-prod.liquid
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{%- if packageManager == "yarn" %}
FROM node:16-alpine as build
# Installing libvips-dev for sharp Compatability
RUN apk update && apk add build-base gcc autoconf automake zlib-dev libpng-dev vips-dev && rm -rf /var/cache/apk/* > /dev/null 2>&1
RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev vips-dev > /dev/null 2>&1
ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}
WORKDIR /opt/
COPY ./package.json ./yarn.lock ./
ENV PATH /opt/node_modules/.bin:$PATH
RUN yarn config set network-timeout 600000 -g && yarn install
RUN yarn config set network-timeout 600000 -g && yarn install --production
WORKDIR /opt/app
COPY ./ .
RUN yarn build
Expand All @@ -27,7 +27,7 @@ CMD ["yarn", "start"]
{%- else %}
FROM node:16-alpine as build
# Installing libvips-dev for sharp Compatability
RUN apk update && apk add build-base gcc autoconf automake zlib-dev libpng-dev vips-dev && rm -rf /var/cache/apk/* > /dev/null 2>&1
RUN apk update && apk add --no-cache build-base gcc autoconf automake zlib-dev libpng-dev vips-dev > /dev/null 2>&1
ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}
WORKDIR /opt/
Expand Down

0 comments on commit bdef39c

Please sign in to comment.