Posts

Showing posts with the label #Docker

Develop Angular App inside Container

Image
Hi Friends, This is Lakshman here. As part of the Series "Angular Best Practices". Today, We will Develop Angular App inside Container . Pre-requisites: The pre-requisites are Node.JS - Click Here Angular CLI - Click Here Install Docker - Click Here VS Code - Click Here Remote - Containers Click Here Once Install Docker & Node.JS install Angular CLI via NPM Package Manager. Implementation: Step 1: Setup Docker For Dev. To Setup Docker for Angular App for Development, Please refer the below, Blog - Click Here Video - Click Here As small Setups, Copy the DockerFile.dev via URL Set Start Script as below json "start": "ng serve --host 0.0.0.0" To Build run below command, powershell docker build -t <appN-name>:dev -f Dockerfile.Dev . Run the Container use below command, powershell docker run -it --rm -p 9001:4200 -v ${PWD}/src:/usr/src/app/src --name <container-name> <app-name>:dev Step 2: Setup Remote ...

Implement Logging in Angular With REST API (MongoDB)

Hi Friends, This is Lakshman here. Welcome back to the Series Angular Best Practices Today, We will Implement Logging for your angular app with REST API . Pre-requisites: The pre-requisites are Node.JS - Click Here Angular CLI - Click Here Docker - Click Here MongoDB - Click Here MongoDB Compass - Click Here For Code Editor its VS Code . Implementation: We will go there the Implementation by Steps, Step 1: Create the MongoDB Database in Docker or Cloud For Docker: docker pull mongo docker run --name mongodb -p 37017:27017 -d mongo For Cloud: Click Here Preferred Option is Docker Step 2: Create Node.JS REST API with MongoDB. Fork the Repo: Click Here else Connect the API URl: https://ngangularpracticesapi.azurewebsites.net/ Step 3: Copy the MongoDB URI to .env like below, MONGO_URI = mongodb://localhost:37017/ngAngularPractices Step 4. Run the API on Local with below commands, npm run start:dev Step 5. Add Config to Environment Configuration File as below, ...

Dockerize Angular App for Dev

Hi Friends, This is Lakshman here. Welcome back to the Series Angular Best Practices Today, We will Dockerize your angular app for Development . Now as days, we develop application with multiple developers. Each one have there own Node.JS Environment. To Solve this issue we can containerize your application to run inside Docker. Pre-requisites: The pre-requisites are Install Docker - Click Here Node.JS - Click Here Angular CLI - Click Here Once Install Docker & Node.JS install Angular CLI via NPM Package Manager. Implementation: On your Existing Angular Application, Create a File Called Dockerfile.Dev Dev indicates for Development Docker File. Inside that Dockerfile.Dev, Copy the below code # Create a new image from the base nodejs 12.7 image. FROM node:12.7-alpine # Create the target directory in the image RUN mkdir -p /usr/src/app # Set the created directory as the working directory WORKDIR /usr/src/app # Copy the package.json inside the working directory COPY...