samchon / nestia

NestJS Helper Libraries + TypeScript OpenAPI generator
https://nestia.io/
MIT License
1.71k stars 89 forks source link

How to properly use nestia in Docker #892

Closed itzRolf closed 2 months ago

itzRolf commented 2 months ago

Question

I always get: Error: Cannot find module "ts-patch" (or "typescript" when trying to install ts-patch globally or 'get-function-location')

My current Dockerfile:

FROM node:lts-alpine

WORKDIR /usr/src/app

ENV NODE_ENV production

COPY package*.json ./
RUN npm install

COPY . .

RUN npx prisma generate
RUN npx nestia setup --manager npm --project tsconfig.json

RUN npm run build

EXPOSE 3000

CMD [ "npm", "run", "start:prod" ]
itzRolf commented 2 months ago

Works without ENV NODE_ENV production