Love Walks Through Rain

Listening to Love Walks Through Rain is as easy as taking in a breeze, the instrumental piano magic just flows, eventually bringing a full spectrum of the quiet emotions. “It is often,” reflects…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




App Deployment With Docker

DEPLOYING WITH DOCKER

A little intro…

Part 1 of this article goes over how to containerise a simple node.js application and deploy it using docker.

Let’s get into it…

a) Image: Specifies the name of the image the container will be built from.

b) Ports: Specifies what ports the container will open.

c) Environment: variables can be specified in the docker compose file, here the user name and password will be mapped to monogo-express, and this is how mongo-express will be able to authenticate to mongodb.

b) RUN: Executes a linux command, the directory being created here is going to live in the container and not the host machine.

c) COPY ./app /home/app: Copies’s the content of ./app/package*.json which is the source into /home/app which is the destination.

d) WORKDIR: Set’s the working directory

e) CMD: Is always in the Dockerfile and it executes an entry point linux command, here the command translates to node server.js, which starts up the application.

note: Difference between CMD and RUN is we can have only one CMD command, but we can have several RUN commands

note: you must first name your local image using your Docker Hub username and the repository name that you created through Docker Hub on the web

here’s my image after building

note: I’ll be using a public registry here

a) log into dockerhub and create a public repository my-app, remember to make it public, by choosing the public option.

public-repository

b) Push the image to docker hub.

layers being pushed
Image pushed to repository

c) Add the app build to docker compose and run the docker compose command once again, so we can have the app container.

see also: App Deployment With Gitlab-CI, see also: App Deployment With Kubernetes

Add a comment

Related posts:

Famous interior designers in delhi.

Hey are you looking for the famous interior designers in delhi? If yes then end your search with SJ Design and Consultant. It is an architecture and interior design firm founded by Architect. Shalini…

Hackers Using CAPTCHA Bypass Tactics in Freejacking Campaign on GitHub

A South Africa-based threat actor known as Automated Libra has been observed employing CAPTCHA bypass techniques to create GitHub accounts in a programmatic fashion as part of a freejacking campaign…

The secrets of a successful music producer

Being a successful music producer involves more than just technical skills — it also requires creativity, business savvy, and the ability to adapt to the constantly changing music industry. Here are…