diff --git a/Dockerfile b/Dockerfile index 1da9527..85482ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,10 +13,14 @@ COPY server/package*.json ./server/ RUN cd client && npm cache clean --force && rm -rf node_modules && npm install RUN cd server && npm install -# Copy source code -COPY . . +# Copy ALL source code and assets +COPY client/src ./client/src +COPY client/public ./client/public +COPY client/*.js ./client/ +COPY client/*.json ./client/ +COPY server ./server -# Install nodemailer and dotenv +# Install required packages RUN npm install nodemailer dotenv date-fns react-icons # Build client @@ -36,7 +40,7 @@ FROM node:14-alpine WORKDIR /app -# Copy built assets from build stage +# Copy built assets and static files from build stage COPY --from=build /app/client/build ./client/build COPY --from=build /app/server ./server COPY --from=build /app/.env ./.env @@ -51,4 +55,4 @@ RUN npm install --only=production EXPOSE 5000 # Start the server -CMD ["npm", "start"] \ No newline at end of file +CMD ["npm", "start"] diff --git a/docker-compose.yml b/docker-compose.yml index 8fd2fe3..34e1c60 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: context: . dockerfile: Dockerfile ports: - - "4000:5000" + - "801:5000" environment: - NODE_ENV=production env_file: