Skip to content

Commit 19cd40e

Browse files
adding docker file data for deployment.
1 parent 8b2afad commit 19cd40e

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

docker/Dockerfile

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,31 +52,30 @@ WORKDIR /app
5252
# Install pnpm globally
5353
RUN npm install -g pnpm
5454

55-
# Copy package.json first
55+
# Copy root package.json and the entire apps directory
5656
COPY package*.json ./
57+
COPY apps ./apps
58+
59+
# Set working directory to the API folder
60+
WORKDIR /app/apps/api
5761

5862
# Install dependencies
5963
RUN npm install --legacy-peer-deps
6064

6165
# Install global NestJS CLI
6266
RUN npm install -g @nestjs/cli@$(node -p "require('./package.json').devDependencies['@nestjs/cli'].replace('^', '')")
6367

64-
# Copy source code
65-
COPY src ./src
66-
COPY tsconfig*.json ./
67-
COPY nest-cli.json ./
68-
6968
# Build the application
7069
RUN npm run build
7170

7271
# Production stage
7372
FROM node:18-alpine AS production
7473

75-
WORKDIR /app
74+
WORKDIR /app/apps/api
7675

77-
COPY --from=base /app/package*.json ./
78-
COPY --from=base /app/node_modules ./node_modules
79-
COPY --from=base /app/dist ./dist
76+
COPY --from=base /app/apps/api/package*.json ./
77+
COPY --from=base /app/apps/api/node_modules ./node_modules
78+
COPY --from=base /app/apps/api/dist ./dist
8079

8180
EXPOSE 3000
8281

0 commit comments

Comments
 (0)