Skip to content

Commit

Permalink
♻️ Re-create the Dockerfile with cache layers in mind
Browse files Browse the repository at this point in the history
  • Loading branch information
marwonline committed Nov 30, 2020
1 parent b35f942 commit 20a2ced
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
FROM node:12-alpine
FROM node:12.18-alpine3.12

EXPOSE 8061

COPY . /iframely

WORKDIR /iframely

ENV NODE_ENV=production
# Create new non-root user
RUN addgroup -S iframelygroup && adduser -S iframely -G iframelygroup

# This will change the config to `config.<VALUE>.js` and the express server to change its behaviour.
# You should overwrite this on the CLI with `-e NODE_ENV=production`.
ENV NODE_ENV=local

## Utilize docker layer cache
COPY package.json yarn.lock /iframely/
RUN yarn install --pure-lockfile --production

COPY . /iframely

RUN apk add --no-cache git && \
yarn install --frozen-lockfile --production
USER iframely

ENTRYPOINT [ "/iframely/docker/entrypoint.sh" ]

0 comments on commit 20a2ced

Please sign in to comment.