diff --git a/Dockerfile b/Dockerfile index 82c657604..913a93a11 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,10 @@ COPY --from=builder /app/node_modules ./node_modules/ COPY --from=builder /app/yarn.lock ./yarn.lock # Copy the package.json, yarn.lock, and build output of server yarn space to leverage Docker cache +COPY --from=builder /app/core ./core/ COPY --from=builder /app/server ./server/ +RUN cd core && yarn install && yarn run build +RUN yarn workspace @janhq/server install && yarn workspace @janhq/server build COPY --from=builder /app/docs/openapi ./docs/openapi/ # Copy pre-install dependencies diff --git a/Dockerfile.gpu b/Dockerfile.gpu index f67990afd..d5ea70499 100644 --- a/Dockerfile.gpu +++ b/Dockerfile.gpu @@ -56,7 +56,10 @@ COPY --from=builder /app/node_modules ./node_modules/ COPY --from=builder /app/yarn.lock ./yarn.lock # Copy the package.json, yarn.lock, and build output of server yarn space to leverage Docker cache +COPY --from=builder /app/core ./core/ COPY --from=builder /app/server ./server/ +RUN cd core && yarn install && yarn run build +RUN yarn workspace @janhq/server install && yarn workspace @janhq/server build COPY --from=builder /app/docs/openapi ./docs/openapi/ # Copy pre-install dependencies diff --git a/server/package.json b/server/package.json index c1a104506..a7cc09b4f 100644 --- a/server/package.json +++ b/server/package.json @@ -13,9 +13,8 @@ "scripts": { "lint": "eslint . --ext \".js,.jsx,.ts,.tsx\"", "test:e2e": "playwright test --workers=1", - "build:core": "cd node_modules/@janhq/core && yarn install && yarn build", - "dev": "yarn build:core && tsc --watch & node --watch build/main.js", - "build": "yarn build:core && tsc" + "dev": "tsc --watch & node --watch build/main.js", + "build": "tsc" }, "dependencies": { "@alumna/reflect": "^1.1.3", @@ -24,7 +23,8 @@ "@fastify/static": "^6.12.0", "@fastify/swagger": "^8.13.0", "@fastify/swagger-ui": "2.0.1", - "@janhq/core": "file:../core", + "@janhq/core": "link:./core", + "@npmcli/arborist": "^7.3.1", "dotenv": "^16.3.1", "fastify": "^4.24.3", "request": "^2.88.2", @@ -41,8 +41,5 @@ "run-script-os": "^1.1.6", "@types/tcp-port-used": "^1.0.4", "typescript": "^5.2.2" - }, - "bundleDependencies": [ - "@janhq/core" - ] + } }