Merge pull request #694 from bigcapitalhq/lerna-shared

feat: Add shared packages to Docker container
This commit is contained in:
Ahmed Bouhuolia
2024-10-06 17:26:39 +02:00
committed by GitHub
13 changed files with 15 additions and 22 deletions

View File

@@ -3,6 +3,7 @@
"version": "independent", "version": "independent",
"npmClient": "pnpm", "npmClient": "pnpm",
"packages": [ "packages": [
"packages/*" "packages/*",
"shared/*"
] ]
} }

View File

@@ -4,11 +4,11 @@
"scripts": { "scripts": {
"dev": "lerna run dev", "dev": "lerna run dev",
"build": "lerna run build", "build": "lerna run build",
"dev:webapp": "lerna run dev --scope \"@bigcapital/webapp\"", "dev:webapp": "lerna run dev --scope \"@bigcapital/webapp\" --scope \"@bigcapital/utils\"",
"build:webapp": "lerna run build --scope \"@bigcapital/webapp\"", "build:webapp": "lerna run build --scope \"@bigcapital/webapp\" --scope \"@bigcapital/utils\"",
"dev:server": "lerna run dev --scope \"@bigcapital/server\"", "dev:server": "lerna run dev --scope \"@bigcapital/server\" --scope \"@bigcapital/utils\"",
"build:server": "lerna run build --scope \"@bigcapital/server\"", "build:server": "lerna run build --scope \"@bigcapital/server\" --scope \"@bigcapital/utils\"",
"serve:server": "lerna run serve --scope \"@bigcapital/server\"", "serve:server": "lerna run serve --scope \"@bigcapital/server\" --scope \"@bigcapital/utils\"",
"test:e2e": "playwright test", "test:e2e": "playwright test",
"prepare": "husky install" "prepare": "husky install"
}, },

View File

@@ -90,11 +90,7 @@ RUN chown node:node /
RUN npm install -g pnpm RUN npm install -g pnpm
# Copy application dependency manifests to the container image. # Copy application dependency manifests to the container image.
COPY ./package*.json ./ COPY --chown=node:node ./ ./
COPY ./pnpm-lock.yaml ./pnpm-lock.yaml
COPY ./lerna.json ./lerna.json
COPY ./pnpm-workspace.yaml ./pnpm-workspace.yaml
COPY ./packages/server/package*.json ./packages/server/
# Install application dependencies # Install application dependencies
RUN apk update RUN apk update
@@ -109,6 +105,6 @@ RUN pnpm install
COPY --chown=node:node ./packages/server ./packages/server COPY --chown=node:node ./packages/server ./packages/server
# # Creates a "dist" folder with the production build # # Creates a "dist" folder with the production build
RUN npm run build:server --skip-nx-cache RUN pnpm run build:server --skip-nx-cache
CMD [ "node", "./packages/server/build/index.js" ] CMD [ "node", "./packages/server/build/index.js" ]

View File

@@ -5,11 +5,7 @@ USER root
WORKDIR /app WORKDIR /app
# Copy application dependency manifests to the container image. # Copy application dependency manifests to the container image.
COPY ./package*.json ./ COPY . .
COPY ./pnpm-lock.yaml ./pnpm-lock.yaml
COPY ./lerna.json ./lerna.json
COPY ./pnpm-workspace.yaml ./pnpm-workspace.yaml
COPY ./packages/webapp/package*.json ./packages/webapp/
# Install application dependencies # Install application dependencies
RUN apk update RUN apk update
@@ -23,7 +19,6 @@ RUN npm install -g pnpm
RUN pnpm install RUN pnpm install
# Build webapp package # Build webapp package
COPY ./packages/webapp /app/packages/webapp
RUN pnpm run build:webapp RUN pnpm run build:webapp
FROM nginx FROM nginx

8
pnpm-lock.yaml generated
View File

@@ -37,8 +37,6 @@ importers:
specifier: ^9.0.5 specifier: ^9.0.5
version: 9.1.2 version: 9.1.2
packages/bigcapital-utils: {}
packages/server: packages/server:
dependencies: dependencies:
'@aws-sdk/client-s3': '@aws-sdk/client-s3':
@@ -49,7 +47,7 @@ importers:
version: 3.583.0 version: 3.583.0
'@bigcapital/utils': '@bigcapital/utils':
specifier: '*' specifier: '*'
version: link:../bigcapital-utils version: link:../../shared/bigcapital-utils
'@casl/ability': '@casl/ability':
specifier: ^5.4.3 specifier: ^5.4.3
version: 5.4.4 version: 5.4.4
@@ -482,7 +480,7 @@ importers:
dependencies: dependencies:
'@bigcapital/utils': '@bigcapital/utils':
specifier: '*' specifier: '*'
version: link:../bigcapital-utils version: link:../../shared/bigcapital-utils
'@blueprintjs-formik/core': '@blueprintjs-formik/core':
specifier: ^0.3.6 specifier: ^0.3.6
version: 0.3.6(@babel/core@7.24.5)(@blueprintjs/core@4.20.2)(@blueprintjs/select@4.9.24)(formik@2.4.6)(react-dom@18.3.1)(react-is@18.3.1)(react@18.3.1) version: 0.3.6(@babel/core@7.24.5)(@blueprintjs/core@4.20.2)(@blueprintjs/select@4.9.24)(formik@2.4.6)(react-dom@18.3.1)(react-is@18.3.1)(react@18.3.1)
@@ -841,6 +839,8 @@ importers:
specifier: ^0.28.1 specifier: ^0.28.1
version: 0.28.5 version: 0.28.5
shared/bigcapital-utils: {}
packages: packages:
/@alloc/quick-lru@5.2.0: /@alloc/quick-lru@5.2.0:

View File

@@ -1,3 +1,4 @@
packages: packages:
# all packages in direct subdirs of packages/ # all packages in direct subdirs of packages/
- 'packages/*' - 'packages/*'
- 'shared/*'