Skip to content

Commit

Permalink
expose port in dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
sayeed205 committed Jul 20, 2023
1 parent 7781058 commit 810d3fb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# and based on a NodeJS 16 image. The multi-stage mechanism allows to build
# the application in a "builder" stage and then create a lightweight production
# image containing the required dependencies and the JS build files.
#
#
# Dockerfile best practices
# https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
# Dockerized NodeJS best practices
Expand Down Expand Up @@ -38,4 +38,6 @@ COPY --from=builder --chown=node:node /home/node/package*.json ./
COPY --from=builder --chown=node:node /home/node/node_modules/ ./node_modules/
COPY --from=builder --chown=node:node /home/node/dist/ ./dist/

CMD ["node", "dist/server.js"]
EXPOSE 5000/tcp

CMD ["npm", "start"]
3 changes: 1 addition & 2 deletions src/auth/user.module.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// user.module.ts
import { Module } from '@nestjs/common';
import { MongooseModule } from '@nestjs/mongoose';

import { User, UserSchema } from './schemas/user.schema';
import { User, UserSchema } from './schemas';

@Module({
imports: [
Expand Down
1 change: 1 addition & 0 deletions src/transaction/schemas/transaction.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export class Transaction {

@Prop()
date: Date;

@Prop({ ref: User.name, type: Types.ObjectId })
addedBy: Types.ObjectId;

Expand Down

0 comments on commit 810d3fb

Please sign in to comment.