Skip to content

Commit

Permalink
Merge pull request #47 from abinth11/bug-fix-docker
Browse files Browse the repository at this point in the history
bug fix in docker file
  • Loading branch information
abinth11 authored Jul 31, 2023
2 parents 5b79478 + b6a4247 commit 7700ac3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions client/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# Build stage
FROM node:20-alpine as build
FROM node:18-alpine as build

# Set the working directory inside the container
WORKDIR /usr/src/reactapp

# Copy only package.json and yarn.lock to leverage Docker caching for faster builds
COPY package.json yarn.lock ./

# Install app dependencies (only production dependencies)
RUN yarn install --frozen-lockfile --production
# Install all dependencies (including development dependencies for the build)
RUN yarn install --frozen-lockfile

# Copy the rest of the files to the container
COPY . .

# Build the React app for production using Vite
# Build the React app for production
RUN yarn build

# Production stage
FROM node:20-alpine
FROM node:18-alpine

# Set the working directory inside the container
WORKDIR /usr/src/reactapp
Expand All @@ -26,7 +26,7 @@ WORKDIR /usr/src/reactapp
COPY --from=build /usr/src/reactapp/build ./build
COPY --from=build /usr/src/reactapp/node_modules ./node_modules

# Expose the port that the app will run on (if using Vite's default port, which is 3000)
# Expose the port that the app will run on
EXPOSE 3000

# Install a lightweight HTTP server to serve the app
Expand Down

0 comments on commit 7700ac3

Please sign in to comment.