Skip to content

Commit

Permalink
fix: backend dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
ledouxm committed May 20, 2024
1 parent a7d8fa9 commit 93ee294
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ FROM with-deps AS backend
WORKDIR /usr/src/app
COPY packages/backend/ ./packages/backend/
COPY packages/pdf/ ./packages/pdf/
RUN pnpm electric-client generate:back
COPY packages/electric-client/ ./packages/electric-client/


COPY db/ ./db/
COPY --from=with-deps /usr/src/app/packages/backend/node_modules ./packages/backend/node_modules
COPY --from=with-deps /usr/src/app/packages/electric-client/node_modules ./packages/electric-client/node_modules

RUN pnpm electric-client generate:back
RUN pnpm backend build
CMD pnpm electric:up;pnpm backend start

Expand Down
3 changes: 1 addition & 2 deletions packages/backend/src/routes/pdfRoutes.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Type, type FastifyPluginAsyncTypebox } from "@fastify/type-provider-typebox";
import { SerializedUser } from "../services/userService";
import { renderToBuffer } from "@react-pdf/renderer";
import { ReportPDFDocument } from "@cr-vif/pdf";
import { Udap } from "@cr-vif/electric-client/frontend";
Expand Down Expand Up @@ -29,7 +28,7 @@ export const pdfPlugin: FastifyPluginAsyncTypebox = async (fastify, _) => {
});
};

const generatePdf = async ({ htmlString, udap }: { htmlString: string; udap: SerializedUser["udap"] }) => {
const generatePdf = async ({ htmlString, udap }: { htmlString: string; udap: Udap }) => {
return renderToBuffer(
<ReportPDFDocument udap={udap as Udap} htmlString={htmlString} images={{ header: "./public/pdf_header.png" }} />,
);
Expand Down

0 comments on commit 93ee294

Please sign in to comment.