Some checks are pending
Build and Deploy Frontend Learner / Build Frontend Learner Docker Image (push) Waiting to run
Build and Deploy Frontend Learner / Deploy E-learning Frontend Learner to Dev Server (push) Blocked by required conditions
Build and Deploy Frontend Learner / Notify Deployment Status (push) Blocked by required conditions
Build and Deploy Backend / Build Backend Docker Image (push) Successful in 18s
Build and Deploy Frontend Management to Dev Server / Build Frontend Management Docker Image (push) Successful in 21s
Build and Deploy Backend / Deploy E-learning Backend to Dev Server (push) Successful in 3s
Build and Deploy Frontend Management to Dev Server / Deploy E-learning Frontend Management to Dev Server (push) Successful in 3s
Build and Deploy Backend / Notify Deployment Status (push) Successful in 1s
Build and Deploy Frontend Management to Dev Server / Notify Deployment Status (push) Successful in 2s
48 lines
966 B
Docker
48 lines
966 B
Docker
# ================================
|
|
# Build Stage
|
|
# ================================
|
|
FROM node:20-alpine AS builder
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package*.json ./
|
|
|
|
# Install dependencies
|
|
RUN npm ci
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Build the application
|
|
RUN npm run build
|
|
|
|
# ================================
|
|
# Production Stage
|
|
# ================================
|
|
FROM node:20-alpine AS production
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Set environment to production
|
|
ENV NODE_ENV=production
|
|
|
|
# Copy package files for preview command
|
|
COPY --from=builder /app/package*.json ./
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
COPY --from=builder /app/.nuxt ./.nuxt
|
|
COPY --from=builder /app/.output ./.output
|
|
|
|
# Expose port
|
|
EXPOSE 3001
|
|
|
|
# Set default environment variables
|
|
ENV HOST=0.0.0.0
|
|
ENV PORT=3001
|
|
ENV NUXT_HOST=0.0.0.0
|
|
ENV NUXT_PORT=3001
|
|
|
|
# Start the application using preview command
|
|
CMD ["node", ".output/server/index.mjs"]
|