Skip to content
/ qp-n8n Public
forked from n8n-io/n8n

Commit

Permalink
ci: Use --chown=node:node in COPY commands in the custom docker ima…
Browse files Browse the repository at this point in the history
…ge (no-changelog) (n8n-io#5913)

add --chown=node:node to COPY commands

By adding `--chown=node:node` when copying the source and removing `RUN chown -R node:node .`, we save several minutes during the image building process.
  • Loading branch information
Jimw383 authored and sunilrr committed Apr 24, 2023
1 parent 9c6a651 commit 55c675b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions docker/images/n8n-custom/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ ARG NODE_VERSION=16
# 1. Create an image to build n8n
FROM n8nio/base:${NODE_VERSION} as builder

COPY turbo.json package.json .npmrc pnpm-lock.yaml pnpm-workspace.yaml jest.config.js tsconfig.json ./
COPY scripts ./scripts
COPY packages ./packages
COPY patches ./patches
COPY --chown=node:node turbo.json package.json .npmrc pnpm-lock.yaml pnpm-workspace.yaml jest.config.js tsconfig.json ./
COPY --chown=node:node scripts ./scripts
COPY --chown=node:node packages ./packages
COPY --chown=node:node patches ./patches

RUN apk add --update libc6-compat jq
RUN corepack enable && corepack prepare --activate
RUN chown -R node:node .
USER node

RUN pnpm install --frozen-lockfile
Expand Down

0 comments on commit 55c675b

Please sign in to comment.