Initial commit from saas-meta
This commit is contained in:
36
Dockerfile
Normal file
36
Dockerfile
Normal file
@@ -0,0 +1,36 @@
|
||||
# Step 1: Build Phase | مرحلة البناء
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Copy package files | نسخ ملفات الحزم
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies | تثبيت الاعتماديات
|
||||
RUN npm install
|
||||
|
||||
# Copy source code | نسخ كود المصدر
|
||||
COPY . .
|
||||
|
||||
# Build the app | بناء التطبيق
|
||||
RUN npm run build
|
||||
|
||||
# Step 2: Production Phase | مرحلة الإنتاج
|
||||
FROM node:20-alpine
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# Copy package files | نسخ ملفات الحزم
|
||||
COPY package*.json ./
|
||||
|
||||
# Install only production dependencies | تثبيت اعتماديات الإنتاج فقط
|
||||
RUN npm install --only=production
|
||||
|
||||
# Copy built files from builder | نسخ الملفات المبنية من مرحلة البناء
|
||||
COPY --from=builder /usr/src/app/dist ./dist
|
||||
|
||||
# Expose port | فتح المنفذ
|
||||
EXPOSE 3001
|
||||
|
||||
# Command to run | أمر التشغيل
|
||||
CMD ["node", "dist/main"]
|
||||
Reference in New Issue
Block a user