Skip to content

Commit

Permalink
build(backend): fix docker build (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
tericcabrel authored Jul 14, 2024
1 parent 48d025b commit 0c6f56c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/rare-geese-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@snipcode/backend': patch
---

Fix backend docker build
8 changes: 4 additions & 4 deletions apps/backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20-buster as builder
FROM node:20-buster AS builder

RUN mkdir app

Expand All @@ -10,19 +10,19 @@ RUN corepack enable && yarn set version berry

RUN yarn install

RUN npx prisma generate --schema=./packages/domain/prisma/schema.prisma
RUN npx prisma@5.14.0 generate --schema=./packages/domain/prisma/schema.prisma

RUN yarn build --filter=...@snipcode/backend


FROM node:20-alpine as schema-builder
FROM node:20-alpine AS schema-builder

WORKDIR /app

COPY --chown=node:node --from=builder /app/packages/domain/prisma/schema.prisma ./app/prisma/

# Generate the Prisma query engine for Node Alpine
RUN npx prisma generate --schema=./app/prisma/schema.prisma && \
RUN npx prisma@5.14.0 generate --schema=./app/prisma/schema.prisma && \
rm ./node_modules/.prisma/client/libquery_engine-rhel-openssl-1.0.x.so.node
# https://www.prisma.io/docs/orm/reference/prisma-schema-reference#binarytargets-options

Expand Down
3 changes: 3 additions & 0 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
"@nestjs/platform-express": "10.3.9",
"@prisma/client": "5.14.0",
"@sentry/node": "8.11.0",
"@snipcode/domain": "workspace:*",
"@snipcode/embed": "workspace:*",
"@snipcode/utils": "workspace:*",
"graphql": "16.9.0",
"reflect-metadata": "0.2.2",
"rxjs": "7.8.1",
Expand Down
5 changes: 4 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5396,6 +5396,9 @@ __metadata:
"@ngneat/falso": "npm:7.2.0"
"@prisma/client": "npm:5.14.0"
"@sentry/node": "npm:8.11.0"
"@snipcode/domain": "workspace:*"
"@snipcode/embed": "workspace:*"
"@snipcode/utils": "workspace:*"
"@types/express": "npm:4.17.21"
"@types/supertest": "npm:6.0.2"
dotenv-cli: "npm:7.4.2"
Expand Down Expand Up @@ -5434,7 +5437,7 @@ __metadata:
languageName: unknown
linkType: soft

"@snipcode/embed@workspace:packages/embed":
"@snipcode/embed@workspace:*, @snipcode/embed@workspace:packages/embed":
version: 0.0.0-use.local
resolution: "@snipcode/embed@workspace:packages/embed"
dependencies:
Expand Down

0 comments on commit 0c6f56c

Please sign in to comment.