Angular — Deployment
Build for Production
ng build --configuration production
Deployment Options
| Platform | Method |
|---|---|
| Netlify | Git push |
| Vercel | Git push |
| Firebase | Firebase CLI |
| AWS S3 | Upload dist |
| Docker | Dockerfile |
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
- Build for production
- Deploy to Netlify
- Set up Firebase hosting
- 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.