Add Docker configuration for deployment and fix Supabase types for contacts table

هذا الالتزام موجود في:
2025-10-29 15:31:19 +03:00
الأصل 39f346ecc8
التزام 2536eeceb4
8 ملفات معدلة مع 473 إضافات و632 حذوفات

عرض الملف

@@ -1,15 +1,8 @@
node_modules
dist
.git
.gitignore
README.md
README_BACKEND.md
BACKEND_SETUP.md
.env
bun.lockb
package-lock.json
.dockerignore
Dockerfile
Dockerfile.backend
docker-compose.yml
nginx.conf
.dockerignore

عرض الملف

@@ -6,6 +6,7 @@ COPY . .
RUN npm run build
FROM nginx:alpine
COPY --from=build /app/build /usr/share/nginx/html
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

20
Dockerfile.backend Normal file
عرض الملف

@@ -0,0 +1,20 @@
# Use Node.js alpine image
FROM node:18-alpine
# Set working directory
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci --only=production
# Copy all files
COPY . .
# Expose port 3001
EXPOSE 3001
# Start the application
CMD ["node", "server.js"]

34
docker-compose.yml Normal file
عرض الملف

@@ -0,0 +1,34 @@
version: '3.8'
services:
# Frontend service using Nginx
frontend:
build:
context: .
dockerfile: Dockerfile
ports:
- "80:80"
depends_on:
- backend
networks:
- app-network
# Backend service
backend:
build:
context: .
dockerfile: Dockerfile.backend
ports:
- "3001:3001"
environment:
- PORT=3001
- EMAIL_USER=${EMAIL_USER}
- EMAIL_PASS=${EMAIL_PASS}
env_file:
- .env
networks:
- app-network
networks:
app-network:
driver: bridge

عرض الملف

@@ -37,7 +37,7 @@ http {
# Proxy API requests to the backend server
location /api/ {
proxy_pass http://localhost:3001/;
proxy_pass http://backend:3001/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';

1005
package-lock.json مولّد

تم حذف اختلاف الملف لأن الملف كبير جداً تحميل الاختلاف

عرض الملف

@@ -59,7 +59,7 @@
"lovable-tagger": "^1.1.11",
"lucide-react": "^0.446.0",
"next-themes": "^0.3.0",
"nodemailer": "^6.9.15",
"nodemailer": "^7.0.10",
"react": "^18.3.1",
"react-day-picker": "^8.10.1",
"react-dom": "^18.3.1",
@@ -72,7 +72,7 @@
"tailwind-merge": "^2.5.2",
"tailwindcss-animate": "^1.0.7",
"vaul": "^1.1.2",
"vite": "^5.4.11",
"vite": "^7.1.12",
"zod": "^3.23.8"
},
"devDependencies": {

عرض الملف

@@ -14,7 +14,33 @@ export type Database = {
}
public: {
Tables: {
[_ in never]: never
contacts: {
Row: {
id: number
name: string
email: string
phone: string | null
message: string
created_at: string | null
}
Insert: {
id?: number
name: string
email: string
phone?: string | null
message: string
created_at?: string | null
}
Update: {
id?: number
name?: string
email?: string
phone?: string | null
message?: string
created_at?: string | null
}
Relationships: []
}
}
Views: {
[_ in never]: never