</>
Skip to content
Angular lessons (37/43)

Angular — Deployment

Build for Production

ng build --configuration production

Deployment Options

PlatformMethod
NetlifyGit push
VercelGit push
FirebaseFirebase CLI
AWS S3Upload dist
DockerDockerfile

Netlify

# netlify.toml
[build]
  command = "ng build --configuration production"
  publish = "dist/my-app"

Firebase

npm install -g firebase-tools
firebase init
firebase deploy

Docker

FROM node:18-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build

FROM nginx:alpine
COPY --from=build /app/dist/my-app /usr/share/nginx/html
EXPOSE 80

Environment Variables

// environments/environment.prod.ts
export const environment = {
  production: true,
  apiUrl: 'https://api.example.com'
};

Mini Practice

  1. Build for production
  2. Deploy to Netlify
  3. Set up Firebase hosting
  4. Create Docker deployment

Up Next

Continue with Standalone Components — standalone Angular.

Related Topics

Frequently Asked Questions about Deployment

What is Deployment in Angular?

Deployment is a fundamental concept in Angular. This lesson explains it step by step with clear examples, making it easy for beginners to understand.

How do I learn Deployment?

Start by reading the explanation above, then try the code examples. Practice by modifying the examples and experimenting with different values. Hands-on practice is the best way to learn Deployment.

Why is Deployment important in Angular?

Deployment is essential for Angular development. Understanding this concept will help you write better code and solve real-world problems more effectively.