-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ Re-create the Dockerfile with cache layers in mind
- Loading branch information
1 parent
b35f942
commit 20a2ced
Showing
1 changed file
with
14 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ] |