https://github.com/astechedu/sample-dockerized-angular-app
This is sample dockerized angular app.
https://github.com/astechedu/sample-dockerized-angular-app
angular angularjs docker docker-angular dockerfile javascript
Last synced: 7 months ago
JSON representation
This is sample dockerized angular app.
- Host: GitHub
- URL: https://github.com/astechedu/sample-dockerized-angular-app
- Owner: astechedu
- Created: 2022-12-29T16:05:40.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-30T12:54:02.000Z (about 3 years ago)
- Last Synced: 2025-03-18T01:49:15.870Z (10 months ago)
- Topics: angular, angularjs, docker, docker-angular, dockerfile, javascript
- Language: Dockerfile
- Homepage:
- Size: 106 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dockerized Angular
#Use official node image as the base image
FROM node:latest as build
#Set the working directory
WORKDIR /usr/local/app
#Add the source code to app
COPY ./ /usr/local/app/
#Install all the dependencies
RUN npm install
#Generate the build of the application
RUN npm run build
#Stage 2: Serve app with nginx server
#Use official nginx image as the base image
FROM nginx:latest
#Copy the build output to replace the default nginx contents.
COPY --from=build /usr/local/app/dist/dockerangular01 /usr/share/nginx/html
#Expose port 80
EXPOSE 80
----- X -----
#Building image
docker build . -t dockerized_angular
#Running container
docker run --name angular-app -p 8080:80 -d dockerized_angular
#On Browser
http://localhost:8080
# Angular
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.0.4.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.