Skip to content

Commit 3e23bee

Browse files
authored
Merge pull request #805 from CodeWithCJ/dev
switched docker to use pnpm instead of npm
2 parents e5a9cf5 + 3012146 commit 3e23bee

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

docker/Dockerfile.frontend

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@
22
FROM node:20-slim AS builder
33
WORKDIR /app/SparkyFitnessFrontend
44

5+
# Install pnpm
6+
RUN corepack enable && corepack prepare pnpm@latest --activate
7+
58
# Copy package files and install dependencies
6-
COPY SparkyFitnessFrontend/package.json SparkyFitnessFrontend/package-lock.json ./
7-
RUN npm install
9+
COPY SparkyFitnessFrontend/package.json SparkyFitnessFrontend/pnpm-lock.yaml ./
10+
RUN pnpm install --frozen-lockfile
811

912
# Copy the rest of the application source code
1013
COPY SparkyFitnessFrontend .
1114

1215
# Build the application
13-
RUN npm run build
16+
RUN pnpm run build
1417

1518
# Stage 2: Serve the application with Nginx
1619
FROM nginx:alpine3.22

docker/Dockerfile.frontend.dev

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
FROM node:20-slim
22

3-
WORKDIR /app
4-
COPY SparkyFitnessFrontend/package.json SparkyFitnessFrontend/package-lock.json ./
5-
RUN npm install
3+
WORKDIR /app/SparkyFitnessFrontend
4+
5+
# Install pnpm
6+
RUN corepack enable && corepack prepare pnpm@latest --activate
7+
8+
COPY SparkyFitnessFrontend/package.json SparkyFitnessFrontend/pnpm-lock.yaml ./
9+
RUN pnpm install
610

711
EXPOSE 8080
812

9-
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]
13+
CMD ["pnpm", "run", "dev", "--host", "0.0.0.0"]

0 commit comments

Comments
 (0)