Skip to content
Open
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
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "yarn"
- run: yarn
- run: yarn build
- run: yarn test
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "yarn"
registry-url: "https://registry.npmjs.org"

- name: Install dependencies and build
Expand Down
20 changes: 17 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,34 @@ COPY .git dappnode_package.json docker/getGitData.js ./
RUN apk add --no-cache git
RUN node getGitData /usr/src/app/.git-data.json

# Extract only package.json files to preserve dependency layer cache
FROM ${BASE_IMAGE} AS manifests
WORKDIR /app
COPY packages packages
RUN find packages -mindepth 2 ! -name "package.json" -delete 2>/dev/null; \
find packages -empty -delete 2>/dev/null; true

# Build stage
FROM ${BASE_IMAGE} AS build-src
ENV VITE_APP_API_URL /
WORKDIR /app

# Copy and build packages
COPY package.json yarn.lock .yarnrc.yml tsconfig.json ./
COPY packages packages
# Copy dependency manifests only (changes less often, preserves layer cache)
COPY package.json yarn.lock .yarnrc.yml ./
COPY --from=manifests /app/packages ./packages

# Install necessary packages required by vite
RUN apk add --no-cache python3 py3-pip build-base
# Install corepack to be able to use modern yarn berry
RUN corepack enable

# Since we copied dependency manifests only, if there are changes in source code,
# that don't change dependencies, we can reuse the cached layer with installed dependencies.
RUN yarn install --immutable

# Copy source code and build
COPY tsconfig.json ./
COPY packages packages
# Build and install production dependencies
RUN yarn build && \
yarn workspaces focus --all --production
Expand Down
Loading