This server depends on the generated Prisma client from the echo-control project. Before running the server, you need to ensure the Prisma client is copied locally.
-
Make sure the
echo-controlproject has generated its Prisma client:cd ../control pnpm run build # or whatever command generates the Prisma client
-
Copy the generated Prisma client:
pnpm run copy-prisma
# Development mode (automatically copies Prisma client)
pnpm run dev
# Production mode
pnpm run build
pnpm startThe dev and start scripts automatically run copy-prisma as a pre-hook, so you don't need to run it manually.
When building a Docker image, you'll need to ensure both projects are available in the build context:
FROM node:18-alpine AS base
# Copy both projects
COPY packages/app/control/ /app/packages/app/control/
COPY packages/app/server/ /app/packages/app/server/
# Build echo-control first
WORKDIR /app/echo-control
RUN pnpm install && pnpm run build
# Build echo-server
WORKDIR /app/echo-server
RUN pnpm install && pnpm run build
FROM node:18-alpine AS runtime
WORKDIR /app
COPY --from=base /app/packages/app/server/dist ./dist
COPY --from=base /app/packages/app/server/node_modules ./node_modules
COPY --from=base /app/packages/app/server/package.json ./package.json
CMD ["pnpm", "start"]- Build the echo-control project and export the generated files
- Copy the generated files into the echo-server build context
- Build the echo-server
copy-prisma: Copies the generated Prisma client from echo-controldev: Runs the development server (with auto-copy)build: Builds the TypeScript code (with auto-copy)start: Starts the production server (with auto-copy)
If the generated Prisma client is not found, the server will throw a descriptive error message asking you to run pnpm run copy-prisma.