Category : nestjs

here is my Dockerfile: FROM node AS builder WORKDIR /app COPY package*.json ./ COPY prisma ./prisma/ COPY tsconfig.build.json ./ COPY tsconfig.json ./ RUN npm install COPY . . RUN npm run build FROM node COPY –from=builder /app/node_modules ./node_modules COPY –from=builder /app/package*.json ./ COPY –from=builder /app/dist ./dist EXPOSE 3000 CMD [ "npm", "run", "start:dev" ] and ..

Read more

Containers in network docker container linker-client-aggregator ping linker-common-service,is ok。 ping docker container docker container name: linker-common-service const app = await NestFactory.createMicroservice<MicroserviceOptions>( AppModule, { transport: Transport.TCP, options: { host: ‘0.0.0.0’, port: 3001, }, }, ); docker container name: linker-client-aggregator @Injectable() export class CommonService { client: ClientProxy; constructor() { console.log(config) this.client = ClientProxyFactory.create({ transport: Transport.TCP, options: { ..

Read more

Containers in network Two containers in the same network. docker container linker-client-aggregator ping linker-common-service,is ok. ping docker container Bridge network is connected. docker container name: linker-common-service const app = await NestFactory.createMicroservice<MicroserviceOptions>( AppModule, { transport: Transport.TCP, options: { host: ‘0.0.0.0’, port: 3001, }, }, ); docker container name: linker-client-aggregator @Injectable() export class CommonService { client: ClientProxy; ..

Read more

I’m struggling to get my node app container to connect to the MongoDB container. However, using MongoDB compass to connect to the containerized db works as expected. The connection string is : mongodb://localhost:27017/auth, but I’ve tried using the container name, 127.0.0.1, 0.0.0.1 but none of it seems to work. With MongoDB, all of the connection ..

Read more

I’m struggling to get my node app container to connect to the MongoDB container. However, using MongoDB compass to connect to the containerized db works as expected. The connection string is : mongodb://localhost:27017/auth, but I’ve tried using the container name, 127.0.0.1, 0.0.0.1 but none of it seems to work. With MongoDB, all of the connection ..

Read more

I have got the following error while trying to create a docker image for aws lambda base on node js typescript image (NestJs) this error occurred also when i use sample app.js file with handler function internal/modules/cjs/loader.js:905 throw err; ^ Error: Cannot find module ‘/function/main.handler’ at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15) at Function.Module._load (internal/modules/cjs/loader.js:746:27) at Function.executeUserEntryPoint [as runMain] ..

Read more