diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 6b306ba..f9aeeb7 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /app # COPY .env . # Copy package.json and package-lock.json -COPY package*.json ./ +COPY ./package.json ./ # Install dependencies RUN npm install --legacy-peer-deps @@ -15,22 +15,23 @@ RUN npm install --legacy-peer-deps COPY . . # Build the app for production -RUN npm run build +# RUN npm run build # Stage 2: Serve the app with NGINX -FROM nginx:alpine +# FROM nginx:alpine # Copy the built files from the previous stage to the NGINX web root -COPY --from=builder /app/dist /usr/share/nginx/html +# COPY --from=builder /app/dist /usr/share/nginx/html #shell to be able to catch variables at docker run time #https://dev.to/sanjayttg/dynamic-environment-variables-for-dockerized-react-apps-5bc5 -COPY env.sh /docker-entrypoint.d/env.sh -RUN chmod +x /docker-entrypoint.d/env.sh +# COPY env.sh /docker-entrypoint.d/env.sh +# RUN chmod +x /docker-entrypoint.d/env.sh # Expose the port NGINX is running on -EXPOSE 80 +# EXPOSE 80 # Start NGINX server -CMD ["nginx", "-g", "daemon off;"] +# CMD ["nginx", "-g", "daemon off;"] +CMD ["npm", "run", "start"]