chore: update dependencies and add .dockerignore file

- Updated MUI packages to version 5.x and x-charts/x-date-pickers to 7.x
- Downgraded React and React-DOM to version 18.3.1
- Added .dockerignore to exclude unnecessary files from Docker context
This commit is contained in:
hamed
2025-12-10 14:06:19 +03:30
parent a8d4d5c090
commit 6f0c29d700
11 changed files with 2838 additions and 2066 deletions
+54
View File
@@ -0,0 +1,54 @@
# Dependencies
node_modules
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Build outputs
.next
out
dist
build
# Testing
coverage
.nyc_output
# Environment files
.env*.local
.env.development
.env.test
# IDE
.vscode
.idea
*.swp
*.swo
*~
# OS
.DS_Store
Thumbs.db
# Git
.git
.gitignore
.gitattributes
# Docker
Dockerfile
docker-compose.yml
.dockerignore
# Documentation
README.md
CHANGELOG.md
LICENSE
# CI/CD
.github
.gitlab-ci.yml
# Misc
*.log
.cache
+1
View File
@@ -1 +1,2 @@
legacy-peer-deps=true
strict-peer-dependencies=false
+1 -1
View File
@@ -10,7 +10,7 @@ function Call({ matchedCity, isDefault }) {
>
<h1 className="text-[#FAFAFA] text-[20px] font-bold">تماس با ما</h1>
<h2 className="text-[#FAFAFA] leading-[26px] text-[14px] md:text-[16px] font-normal mt-6">
{matchedCity.footerDescription}
{matchedCity?.footerDescription || "برای ارتباط با ما از راه های زیر استفاده کنید"}
</h2>
<Links matchedCity={matchedCity} />
</div>
+3 -3
View File
@@ -11,20 +11,20 @@ function Links({ matchedCity }) {
<ContentContact
url="tel:900300400"
label="تلفن تماس: "
text={matchedCity.contactPhone}
text={matchedCity?.contactPhone || "900300400"}
>
<CallC />
</ContentContact>
<ContentContact
url="https://wa.me/09124568794"
text={matchedCity.socialMedia.whatsapp}
text={matchedCity?.socialMedia?.whatsapp || "09124568794"}
label="واتساپ: "
>
<WhatsappC />
</ContentContact>
<ContentContact
url="mailto:batome@gmail.com"
text={matchedCity.email}
text={matchedCity?.email || "info@nobat724.com"}
label="ایمیل: "
>
<EmailC />
+2 -2
View File
@@ -2,8 +2,8 @@ import { getStateInfo } from "@/lib/getStateInfo";
import Call from "./call/Call";
import Connect from "./Connect";
function ContactUsPage() {
const { matchedCity } = getStateInfo();
async function ContactUsPage() {
const { matchedCity } = await getStateInfo();
const isDefault = matchedCity?.id === "63";
return (
+1 -2
View File
@@ -1,5 +1,4 @@
import Image from "next/image";
import Logo from "@/public/assets/images/logo.png";
import Services from "./Services";
import Address from "./Address";
import Telefon from "./Telefon";
@@ -11,7 +10,7 @@ function Poster({ data }) {
<div className="bg-poster overflow-hidden !pt-[32px] p-[24px] relative flex justify-between items-start">
<div>
<div className="flex items-center justify-start gap-[5px]">
<Image src={Logo} width={30} height={30} alt="logo" />
<Image src="/assets/images/logo.png" width={30} height={30} alt="logo" />
<p className="text-[#E7EEF6] text-[16px] font-bold !-translate-y-1">
nobat724.com
</p>
+59 -29
View File
@@ -1,54 +1,84 @@
# =============================================================================
# Docker Compose - Production Configuration for Coolify
# Docker Compose - Production Configuration
# =============================================================================
# Optimized for:
# - Fast cold starts
# - Minimal resource usage
# - Zero-downtime deployments
# - Coolify compatibility
# Optimized for: Coolify deployment with production best practices
# =============================================================================
services:
app:
image: nobat724-front:latest
container_name: nobat724-app
build:
context: .
dockerfile: Dockerfile
# Enable BuildKit for faster builds and layer caching
# Enable BuildKit for better caching
args:
- BUILDKIT_INLINE_CACHE=1
- DOCKER_BUILDKIT=1
# Cache strategy for faster rebuilds
cache_from:
- node:20-alpine
BUILDKIT_INLINE_CACHE: "1"
# Multi-platform support (optional)
# platforms:
# - linux/amd64
# - linux/arm64
# Container restart policy
# Restart policy
restart: unless-stopped
# Dynamic port mapping (Coolify manages external port)
# Port mapping (Coolify handles external mapping)
ports:
- "3000"
- "3000:3000"
# Environment variables
# Note: Coolify injects these automatically from project settings
environment:
# Node.js
- NODE_ENV=${NODE_ENV:-production}
- PORT=3000
- HOSTNAME=0.0.0.0
- DEV_MODE=false
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
- NEXT_PUBLIC_CLIENT_ID=${NEXT_PUBLIC_CLIENT_ID}
- NEXT_PUBLIC_CLIENT_SECRET=${NEXT_PUBLIC_CLIENT_SECRET}
# Next.js runtime
PORT: 3000
HOSTNAME: "0.0.0.0"
NODE_ENV: production
NEXT_TELEMETRY_DISABLED: 1
# Resource limits (optimized for low traffic sites)
# API configuration
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-https://api.nobat724.com}
NEXT_PUBLIC_CLIENT_ID: ${NEXT_PUBLIC_CLIENT_ID}
NEXT_PUBLIC_CLIENT_SECRET: ${NEXT_PUBLIC_CLIENT_SECRET}
DEV_MODE: "false"
# Health check (uses Dockerfile HEALTHCHECK)
healthcheck:
test:
[
"CMD-SHELL",
'node -e "require(''http'').get(''http://localhost:3000/'', (res) => { process.exit(res.statusCode === 200 ? 0 : 1); }).on(''error'', () => { process.exit(1); });"',
]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Resource limits
deploy:
resources:
limits:
cpus: "0.5"
memory: 512M
cpus: "1.0"
memory: 1G
reservations:
cpus: "0.1"
memory: 128M
cpus: "0.25"
memory: 256M
# Logging configuration
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# Security options
security_opt:
- no-new-privileges:true
# Read-only root filesystem (except for .next cache)
# read_only: true
# tmpfs:
# - /tmp
# - /app/.next/cache
# Networks (Coolify uses bridge network)
networks:
+68 -27
View File
@@ -1,48 +1,89 @@
# Dockerfile for Next.js 14 - Optimized for Production
# =============================================================================
# Multi-stage Dockerfile for Next.js 15 - Production Optimized
# =============================================================================
# Stage 1: Dependencies - Install all dependencies
# Stage 2: Builder - Build the application
# Stage 3: Runner - Production runtime
# =============================================================================
# Use the official Node.js image with Alpine Linux for a smaller footprint
FROM node:22-alpine AS base
# -----------------------------------------------------------------------------
# Stage 1: Dependencies
# -----------------------------------------------------------------------------
FROM node:22-alpine AS deps
# Install system dependencies for node-gyp
RUN apk add --no-cache libc6-compat
# Set the working directory in the container
WORKDIR /app
# Copy package.json and package-lock.json (or yarn.lock)
COPY package*.json ./
# Copy dependency files
COPY package.json package-lock.json* ./
# Install dependencies - leveraging Docker cache
RUN npm i --force
# Install dependencies
# Use npm ci for reproducible builds
RUN npm ci --legacy-peer-deps || npm install --legacy-peer-deps
# Copy the rest of the application code
# -----------------------------------------------------------------------------
# Stage 2: Builder
# -----------------------------------------------------------------------------
FROM node:22-alpine AS builder
WORKDIR /app
# Copy dependencies from deps stage
COPY --from=deps /app/node_modules ./node_modules
# Copy source code
COPY . .
# Build the Next.js application
# Set build-time environment variables
ENV NEXT_TELEMETRY_DISABLED=1
ENV NODE_ENV=production
# Build application
RUN npm run build
# Stage 2: Production image - smaller and leaner
# -----------------------------------------------------------------------------
# Stage 3: Runner (Production)
# -----------------------------------------------------------------------------
FROM node:22-alpine AS runner
# Set the working directory
# Install runtime dependencies
RUN apk add --no-cache \
libc6-compat \
dumb-init
WORKDIR /app
# Set environment variables
ENV NODE_ENV $NODE_ENV
ENV NEXT_TELEMETRY_DISABLED 1
# Set production environment
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
# Add a non-root user for security
RUN addgroup -g 1001 -S nodejs
RUN adduser -S nextjs -u 1001
# Create non-root user for security
RUN addgroup --system --gid 1001 nodejs && \
adduser --system --uid 1001 nextjs
# Copy only the necessary files from the builder stage
COPY --from=base /app/next.config.js ./
COPY --from=base /app/public ./public
COPY --from=base --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=base --chown=nextjs:nodejs /app/.next/static ./.next/static
# Copy necessary files from builder
COPY --from=builder --chown=nextjs:nodejs /app/next.config.js ./
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next
COPY --from=builder --chown=nextjs:nodejs /app/package.json ./
COPY --from=builder --chown=nextjs:nodejs /app/node_modules ./node_modules
# Change ownership of all copied files to the non-root user
# Switch to non-root user
USER nextjs
# Expose the port Next.js listens on
# Expose port
EXPOSE 3000
# Command to start the Next.js server in production mode
CMD ["node", "server.js"]
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD node -e "require('http').get('http://localhost:3000/', (res) => { process.exit(res.statusCode === 200 ? 0 : 1); }).on('error', () => { process.exit(1); });"
# Use dumb-init to handle signals properly
ENTRYPOINT ["dumb-init", "--"]
# Start Next.js in production mode
CMD ["node_modules/.bin/next", "start"]
-1
View File
@@ -1,6 +1,5 @@
// next.config.js
const nextConfig = {
output: "standalone",
// Add other configurations below
reactStrictMode: true,
images: {
+2637 -1993
View File
File diff suppressed because it is too large Load Diff
+11 -7
View File
@@ -15,11 +15,11 @@
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@maptiler/sdk": "^3.9.0",
"@mui/icons-material": "^7.3.6",
"@mui/material": "^7.3.6",
"@mui/styled-engine-sc": "^7.3.6",
"@mui/x-charts": "^8.21.0",
"@mui/x-date-pickers": "^8.21.0",
"@mui/icons-material": "^5.18.0",
"@mui/material": "^5.18.0",
"@mui/styled-engine": "^5.18.0",
"@mui/x-charts": "^7.29.1",
"@mui/x-date-pickers": "^7.29.4",
"@next/third-parties": "^15.5.7",
"aos": "^2.3.4",
"axios": "^1.13.2",
@@ -38,8 +38,8 @@
"npm": "^11.7.0",
"qrcode": "^1.5.4",
"qrcode.react": "^4.2.0",
"react": "^19.2.1",
"react-dom": "^19.2.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-easy-crop": "^5.5.6",
"react-google-map-picker": "^1.2.3",
"react-images-uploading": "^3.1.7",
@@ -56,5 +56,9 @@
"postcss": "^8.5.6",
"prettier": "^3.7.4",
"tailwindcss": "^3.4.18"
},
"overrides": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
}
}