diff --git a/Dockerfile-dev b/Dockerfile-dev index 9b9493f..eb0655f 100644 --- a/Dockerfile-dev +++ b/Dockerfile-dev @@ -1,21 +1,26 @@ -#SET NODE VERSION +# Use the official Node.js 18 image as base FROM node:18.17.1 -#CONTAINER WORKING DIRECTORY +# Set the working directory in the container WORKDIR /usr/src/app -#COPY FILES INTO CONTANER AT /usr/src/app -COPY . . +# Copy the package.json and package-lock.json (if available) +COPY package*.json ./ -#TYING TO EXPLICITLY COPY THE CLIENT FOLDER -COPY ./client /usr/src/app/client +# Install root packages +RUN npm install -#INSTALL ROOT PACKAGES +# Copy the rest of your app's source code from your host to your image filesystem. +COPY . . + +# Navigate to the client directory and install client packages +WORKDIR /usr/src/app/client +COPY client/package*.json ./ RUN npm install -#INSTAL CLIENT PACKAGES -RUN cd client && npm install +# Navigate back to the main app directory +WORKDIR /usr/src/app -#EXPOSE THE WEBPACK-DEV-SERVER PORT +# Expose the port the app runs on EXPOSE 3000