30 lines
920 B
Docker
30 lines
920 B
Docker
# =========================================
|
|
# Stage 1: Development - Angular Application
|
|
# =========================================
|
|
|
|
# Define the Node.js version to use (Alpine for a small footprint)
|
|
ARG NODE_VERSION=24.7.0-alpine
|
|
|
|
# Set the base image for development
|
|
FROM node:${NODE_VERSION} AS dev
|
|
|
|
# Set environment variable to indicate development mode
|
|
ENV NODE_ENV=development
|
|
|
|
# Set the working directory inside the container
|
|
WORKDIR /app
|
|
|
|
# Copy only the dependency files first to optimize Docker caching
|
|
COPY package.json package-lock.json ./
|
|
|
|
# Install dependencies using npm with caching to speed up subsequent builds
|
|
RUN --mount=type=cache,target=/root/.npm npm install
|
|
|
|
# Copy all application source files into the container
|
|
COPY . .
|
|
|
|
# Expose the port Angular uses for the dev server (default is 4200)
|
|
EXPOSE 4200
|
|
|
|
# Start the Angular dev server and bind it to all network interfaces
|
|
CMD ["npm", "start"] |