You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.6 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
  1. # Base image
  2. FROM node:18.20.5
  3. # Set working directory
  4. WORKDIR /usr/src/app
  5. # Copy package.json and package-lock.json (if exists)
  6. COPY package.json ./
  7. RUN apt-get update && apt-get install -y build-essential
  8. RUN rm -rf .next
  9. # Install dependencies
  10. RUN npm install --legacy-peer-deps
  11. # RUN npm ci
  12. # Copy the rest of the application code
  13. COPY . .
  14. # Set environment variables
  15. ENV NEXT_PUBLIC_DEFAULT_LANGUAGE=en
  16. ENV NEXT_PUBLIC_AVAILABLE_LANGUAGES=en
  17. ENV NEXT_PUBLIC_ENABLE_MULTI_LANG=true
  18. ENV NODE_ENV=production
  19. ENV NEXT_PUBLIC_REST_API_ENDPOINT=https://mesbahi.nwhco.ir/api
  20. ENV NEXT_PUBLIC_SITE_URL=https://mesbahi.nwhco.ir
  21. ENV USE_MOCK_DATA=false
  22. ENV USE_MOCK_DATA=true
  23. # Verify environment variables (برای دیباگ)
  24. # RUN echo "NEXT_PUBLIC_DEFAULT_LANGUAGE=${NEXT_PUBLIC_DEFAULT_LANGUAGE}" && \
  25. # echo "NEXT_PUBLIC_AVAILABLE_LANGUAGES=${NEXT_PUBLIC_AVAILABLE_LANGUAGES}" && \
  26. # echo "NEXT_PUBLIC_ENABLE_MULTI_LANG=${NEXT_PUBLIC_ENABLE_MULTI_LANG}"
  27. # Modify tsconfig.json to ignore type errors (optional)
  28. # RUN sed -i 's/"noEmitOnError": true/"noEmitOnError": false/' tsconfig.json && \
  29. # sed -i 's/"strict": true/"strict": false/' tsconfig.json && \
  30. # sed -i 's/"skipLibCheck": false/"skipLibCheck": true/' tsconfig.json
  31. # # Modify next.config.js to ignore linting and type errors
  32. # RUN sed -i '/eslint:/a \ \ ignoreDuringBuilds: true,' next.config.js && \
  33. # sed -i '/typescript:/a \ \ ignoreBuildErrors: true,' next.config.js
  34. # Build the Next.js application with verbose logging
  35. RUN npm run build --verbose
  36. # Expose the port the app runs on
  37. EXPOSE 3000
  38. # Start the application
  39. CMD ["npm", "start"]