diff --git a/docker-compose.yml b/docker-compose.yml index d97cb4f0dd..7646119b79 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -84,7 +84,8 @@ services: watch: build: - context: ./frontends + context: . + dockerfile: frontends/Dockerfile command: > /bin/sh -c 'yarn rebuild && yarn watch:docker' environment: diff --git a/frontends/.yarnrc.yml b/frontends/.yarnrc.yml deleted file mode 100644 index d44361a1d4..0000000000 --- a/frontends/.yarnrc.yml +++ /dev/null @@ -1,19 +0,0 @@ -nodeLinker: node-modules - -yarnPath: .yarn/releases/yarn-4.1.1.cjs - -# https://github.com/vitejs/vite-plugin-react-swc/issues/74#issuecomment-1520484130 -# https://github.com/swc-project/swc/issues/5616#issuecomment-1265639797 -# This setting ensures we always install the Linux binaries when running `yarn install`. This is needed for running -# swc natively in Docker (addresses swc-loader bindings not found error). -supportedArchitectures: - os: - - current - - linux - cpu: - - current - - x64 - - arm64 - libc: - - current - - glibc diff --git a/frontends/Dockerfile b/frontends/Dockerfile index 22e507e85e..616402beb7 100644 --- a/frontends/Dockerfile +++ b/frontends/Dockerfile @@ -1,16 +1,21 @@ FROM node:20.12-alpine LABEL maintainer "ODL DevOps " -COPY . /src +COPY ./package.json /src/package.json +COPY ./yarn.lock /src/yarn.lock +COPY ./.yarn /src/.yarn +COPY ./frontends /src/frontends WORKDIR /src RUN yarn set version 4.1.1 -RUN yarn install --immutable +RUN yarn install # Rebuilds for the case that the lockfile contains platform-specific dependencies RUN yarn rebuild +WORKDIR /src/frontends + RUN yarn build-storybook CMD ["yarn", "watch:docker"] diff --git a/frontends/api/package.json b/frontends/api/package.json index 053ef8d8ff..a3ae08bbcf 100644 --- a/frontends/api/package.json +++ b/frontends/api/package.json @@ -12,8 +12,6 @@ "./test-utils": "./src/test-utils/index.ts" }, "peerDependencies": { - "@tanstack/react-query": "^4.36.1", - "axios": "^1.6.3", "react": "^18.2.0" }, "devDependencies": { @@ -24,6 +22,8 @@ "ol-test-utilities": "0.0.0" }, "dependencies": { - "@lukemorales/query-key-factory": "^1.3.2" + "@lukemorales/query-key-factory": "^1.3.2", + "@tanstack/react-query": "^4.36.1", + "axios": "^1.6.3" } } diff --git a/package.json b/package.json index ae5f531811..a068d9b8f2 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "private": true, "engines": { "node": "^20", - "yarn": "^3.8.1" + "yarn": "^4.1.1" }, "workspaces": [ "frontends" diff --git a/yarn.lock b/yarn.lock index 3117e33e69..7ef8e618fb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7327,13 +7327,13 @@ __metadata: dependencies: "@faker-js/faker": "npm:^7.3.0" "@lukemorales/query-key-factory": "npm:^1.3.2" + "@tanstack/react-query": "npm:^4.36.1" "@testing-library/react": "npm:^14.1.2" + axios: "npm:^1.6.3" jest-when: "npm:^3.6.0" lodash: "npm:^4.17.21" ol-test-utilities: "npm:0.0.0" peerDependencies: - "@tanstack/react-query": ^4.36.1 - axios: ^1.6.3 react: ^18.2.0 languageName: unknown linkType: soft