Skip to content

Commit

Permalink
fix pnpm docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
lukesthl committed Oct 23, 2023
1 parent d7ee3d8 commit d8082db
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.git
.gitignore
*.md
dist
2 changes: 1 addition & 1 deletion .github/workflows/deploy-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
uses: docker/build-push-action@v3
with:
file: 'Dockerfile'
context: '{{defaultContext}}:apps/api'
context: '.'
platforms: linux/amd64
push: true
tags: ${{ steps.docker-meta.outputs.tags }}
Expand Down
4 changes: 2 additions & 2 deletions apps/api/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-l

FROM base AS build
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run build
RUN pnpm run build:api

FROM base
COPY --from=prod-deps /app/node_modules /app/node_modules
COPY --from=build /app/dist /app/dist
COPY --from=build /app/apps/api/dist /app/dist
EXPOSE 3000
CMD [ "pnpm", "start:prod" ]
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"fix": "manypkg fix",
"lint": "pnpm run --filter \"{apps/*}\" --stream --parallel lint",
"build": "pnpm run --filter \"{apps/*}\" --stream --parallel build",
"build:api": "pnpm run --filter @acme/api build",
"start:prod": "pnpm run --filter @acme/api start:prod",
"upgrade:tamagui": "pnpm up '*tamagui*'@latest '@tamagui/*'@latest react-native-web-lite@latest",
"check-deps": "check-dependency-version-consistency ."
},
Expand Down

0 comments on commit d8082db

Please sign in to comment.