Skip to content

Commit

Permalink
Merge pull request #694 from bigcapitalhq/lerna-shared
Browse files Browse the repository at this point in the history
feat: Add shared packages to Docker container
  • Loading branch information
abouolia authored Oct 6, 2024
2 parents 1846480 + 6cad929 commit 3cd5465
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 22 deletions.
3 changes: 2 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "independent",
"npmClient": "pnpm",
"packages": [
"packages/*"
"packages/*",
"shared/*"
]
}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"scripts": {
"dev": "lerna run dev",
"build": "lerna run build",
"dev:webapp": "lerna run dev --scope \"@bigcapital/webapp\"",
"build:webapp": "lerna run build --scope \"@bigcapital/webapp\"",
"dev:server": "lerna run dev --scope \"@bigcapital/server\"",
"build:server": "lerna run build --scope \"@bigcapital/server\"",
"serve:server": "lerna run serve --scope \"@bigcapital/server\"",
"dev:webapp": "lerna run dev --scope \"@bigcapital/webapp\" --scope \"@bigcapital/utils\"",
"build:webapp": "lerna run build --scope \"@bigcapital/webapp\" --scope \"@bigcapital/utils\"",
"dev:server": "lerna run dev --scope \"@bigcapital/server\" --scope \"@bigcapital/utils\"",
"build:server": "lerna run build --scope \"@bigcapital/server\" --scope \"@bigcapital/utils\"",
"serve:server": "lerna run serve --scope \"@bigcapital/server\" --scope \"@bigcapital/utils\"",
"test:e2e": "playwright test",
"prepare": "husky install"
},
Expand Down
8 changes: 2 additions & 6 deletions packages/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,7 @@ RUN chown node:node /
RUN npm install -g pnpm

# Copy application dependency manifests to the container image.
COPY ./package*.json ./
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/
COPY --chown=node:node ./ ./

# Install application dependencies
RUN apk update
Expand All @@ -109,6 +105,6 @@ RUN pnpm install
COPY --chown=node:node ./packages/server ./packages/server

# # 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" ]
7 changes: 1 addition & 6 deletions packages/webapp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ USER root
WORKDIR /app

# Copy application dependency manifests to the container image.
COPY ./package*.json ./
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/
COPY . .

# Install application dependencies
RUN apk update
Expand All @@ -23,7 +19,6 @@ RUN npm install -g pnpm
RUN pnpm install

# Build webapp package
COPY ./packages/webapp /app/packages/webapp
RUN pnpm run build:webapp

FROM nginx
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
packages:
# all packages in direct subdirs of packages/
- 'packages/*'
- 'shared/*'
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 3cd5465

Please sign in to comment.