Skip to content

Commit

Permalink
chores: docker cache node_modules
Browse files Browse the repository at this point in the history
  • Loading branch information
ido-pluto committed Nov 3, 2023
1 parent 9706f70 commit 4d12323
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@ FROM node:20 as build

WORKDIR /app

COPY package*.json ./
RUN npm ci

COPY . .

# Build the React app for production
RUN npm ci
RUN npm run build

# Use Nginx as the production server
FROM nginx:alpine

# Copy the built React app to Nginx's web server directory
COPY --from=build /app/dist /usr/share/nginx/html
WORKDIR /usr/share/nginx/html

COPY --from=prod /app/dist .

EXPOSE 80

Expand Down

0 comments on commit 4d12323

Please sign in to comment.