Docker live with sagar kakkala | Dockerfile

Here in this session, since the blogs are already existing, we will be using Blogs that we have used Docker

let us use free kodekloud labs, when we need linux terminal to ease our practise

To install and use Docker , use code snippets from - DevOps with Sagar Kakkala- Day2

to push docker image to Docker Hub, use code snippets from - DevOps with Sagar Kakkala-Day3

To install Docker Desktop and use Docker compose file, use code snippets from - AIOPS/MLOPS with Sagar Kakkala-Day6


Docker File without nginx

# Step 1: Build React app

FROM node:18 AS build


WORKDIR /app


COPY package.json package-lock.json ./

RUN npm install


COPY . .

RUN npm run build



# Step 2: Serve the build

FROM node:18


WORKDIR /app


RUN npm install -g serve


COPY --from=build /app/build ./build


EXPOSE 3000


CMD ["serve", "-s", "build"]


other Docker File components are ENTRYPOINT - stricter startup, while multiple CMD only takes last command

ADD - can download from URL and also extract zip files

ENV - to specify environment variables





Comments