Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(planner/nodejs): Cache dependencies installation #123

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions internal/nodejs/__snapshots__/template_test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ ENV PORT=8080
WORKDIR /src

RUN corepack enable && corepack prepare --all

# Install dependencies and create a cache layer.
COPY package.json* package-lock.json* yarn.lock* pnpm-lock.yaml* .npmrc* ./
RUN yarn install

COPY . .

# Try to install again in case there were something we didn't catch
RUN yarn install

# Build if we can build it
Expand All @@ -27,8 +33,14 @@ ENV PORT=8080
WORKDIR /src

RUN corepack enable && corepack prepare --all

# Install dependencies and create a cache layer.
COPY package.json* package-lock.json* yarn.lock* pnpm-lock.yaml* .npmrc* ./
RUN yarn install

COPY . .

# Try to install again in case there were something we didn't catch
RUN yarn install

# Build if we can build it
Expand Down Expand Up @@ -59,8 +71,14 @@ ENV PORT=8080
WORKDIR /src

RUN corepack enable && corepack prepare --all

# Install dependencies and create a cache layer.
COPY package.json* package-lock.json* yarn.lock* pnpm-lock.yaml* .npmrc* ./
RUN yarn install

COPY . .

# Try to install again in case there were something we didn't catch
RUN yarn install

# Build if we can build it
Expand Down Expand Up @@ -91,8 +109,14 @@ ENV PORT=8080
WORKDIR /src

RUN corepack enable && corepack prepare --all

# Install dependencies and create a cache layer.
COPY package.json* package-lock.json* yarn.lock* pnpm-lock.yaml* .npmrc* ./
RUN yarn install

COPY . .

# Try to install again in case there were something we didn't catch
RUN yarn install

# Build if we can build it
Expand All @@ -112,8 +136,14 @@ ENV PORT=8080
WORKDIR /src

RUN corepack enable && corepack prepare --all

# Install dependencies and create a cache layer.
COPY package.json* package-lock.json* yarn.lock* pnpm-lock.yaml* .npmrc* ./
RUN yarn install

COPY . .

# Try to install again in case there were something we didn't catch
RUN yarn install

# Build if we can build it
Expand Down
6 changes: 6 additions & 0 deletions internal/nodejs/templates/template.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ ENV PORT=8080
WORKDIR /src

RUN corepack enable && corepack prepare --all

# Install dependencies and create a cache layer.
COPY package.json* package-lock.json* yarn.lock* pnpm-lock.yaml* .npmrc* ./
RUN {{ .InstallCmd }}

COPY . .

# Try to install again in case there were something we didn't catch
RUN {{ .InstallCmd }}

# Build if we can build it
Expand Down