Skip to content

Commit cda5060

Browse files
committed
use corepack to build with yarn
1 parent 3c5fbac commit cda5060

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

packages/csr-daisyui/.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v3
16-
- uses: actions/setup-node@v3
16+
- name: Enable Corepack
17+
run: corepack enable
18+
- uses: actions/setup-node@v4
1719
with:
1820
node-version: 22
1921
- name: Trying to install dependencies and build the application

packages/csr-daisyui/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
FROM node:22-slim AS build
1+
FROM node:22-alpine AS build
2+
RUN corepack enable
3+
24
COPY . .
3-
RUN yarn install
5+
RUN yarn --version
6+
RUN yarn install --immutable
47
RUN yarn run build:prod
58

69
FROM caddy:2

packages/ssr-daisyui/.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v3
16-
- uses: actions/setup-node@v3
16+
- name: Enable Corepack
17+
run: corepack enable
18+
- uses: actions/setup-node@v4
1719
with:
1820
node-version: 22
1921
- name: Trying to install dependencies and build the application

packages/ssr-daisyui/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
FROM node:22-alpine AS base
2+
RUN corepack enable
23

34
# Install dependencies
45
FROM base AS deps
56
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
67
RUN apk add --no-cache libc6-compat
8+
79
WORKDIR /app
810

911
COPY .yarnrc.yml ./
10-
COPY .yarn ./.yarn/
1112
COPY package.json yarn.lock ./
1213

13-
RUN yarn --immutable
14+
RUN yarn --version
15+
RUN yarn install --immutable
16+
1417

1518
# Build the application
1619
FROM base AS builder
@@ -20,7 +23,6 @@ ARG NODE_ENV=production
2023
ENV NODE_ENV=$NODE_ENV
2124

2225
COPY --from=deps /app/node_modules ./node_modules
23-
COPY --from=deps /app/.yarn ./.yarn
2426
COPY --from=deps /app/.yarnrc.yml ./.yarnrc.yml
2527
COPY --from=deps /app/package.json ./package.json
2628
COPY --from=deps /app/yarn.lock ./yarn.lock

packages/ssr-daisyui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"build": "yarn run typecheck && react-router build",
1515
"dev": "react-router dev",
1616
"lint": "eslint --cache --cache-location ./node_modules/.cache/eslint .",
17-
"lint-fix": "eslint --fix --cache --cache-location ./node_modules/.cache/eslint .",
17+
"lint:fix": "eslint --fix --cache --cache-location ./node_modules/.cache/eslint .",
1818
"pretty": "prettier --write \"app/**/*.{js,json,ts,tsx}\"",
1919
"start": "react-router-serve build/server/index.js",
2020
"typecheck": "react-router typegen && tsc --build --noEmit",

0 commit comments

Comments
 (0)