Final integrated deployment: UI served on /frontend path, Unified Docker container
This commit is contained in:
14
Dockerfile
14
Dockerfile
@@ -1,4 +1,12 @@
|
||||
# Step 1: Build Backend | مرحلة بناء الخلفية
|
||||
# Step 1: Build Frontend | مرحلة بناء الواجهة
|
||||
FROM node:20-alpine AS frontend-builder
|
||||
WORKDIR /usr/src/app/frontend
|
||||
COPY frontend/package*.json ./
|
||||
RUN npm install
|
||||
COPY frontend/ ./
|
||||
RUN npm run build
|
||||
|
||||
# Step 2: Build Backend | مرحلة بناء الخلفية
|
||||
FROM node:20-alpine AS builder
|
||||
WORKDIR /usr/src/app
|
||||
COPY package*.json ./
|
||||
@@ -6,12 +14,14 @@ RUN npm install
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# Step 2: Production Phase | مرحلة الإنتاج
|
||||
# Step 3: Production Phase | مرحلة الإنتاج
|
||||
FROM node:20-alpine
|
||||
WORKDIR /usr/src/app
|
||||
COPY package*.json ./
|
||||
RUN npm install --only=production
|
||||
COPY --from=builder /usr/src/app/dist ./dist
|
||||
# Copy frontend build to backend public folder | نسخ واجهة المستخدم إلى الملفات العامة
|
||||
COPY --from=frontend-builder /usr/src/app/frontend/dist ./public
|
||||
|
||||
# Expose port | فتح المنفذ
|
||||
EXPOSE 3660
|
||||
|
||||
Reference in New Issue
Block a user