Skip to content

Commit

Permalink
server install core using link instead of file (janhq#2025)
Browse files Browse the repository at this point in the history
Co-authored-by: Hien To <[email protected]>
  • Loading branch information
hiento09 and hientominh authored Feb 15, 2024
1 parent 3412a23 commit 9cc9b4d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile.gpu
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 5 additions & 8 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -41,8 +41,5 @@
"run-script-os": "^1.1.6",
"@types/tcp-port-used": "^1.0.4",
"typescript": "^5.2.2"
},
"bundleDependencies": [
"@janhq/core"
]
}
}

0 comments on commit 9cc9b4d

Please sign in to comment.