Skip to content

Instantly share code, notes, and snippets.

@bhaveshxrawat
bhaveshxrawat / Dockerfile
Created September 23, 2024 12:40
Dockerfile Template
# set the base image to create the image for react app
FROM node:20-alpine
# create a user with permissions to run the app
# -S -> create a system user
# -G -> add the user to a group
# This is done to avoid running the app as root
# If the app is run as root, any vulnerability in the app can be exploited to gain access to the host system
# It's a good practice to run the app as a non-root user
RUN addgroup app && adduser -S -G app app
@bhaveshxrawat
bhaveshxrawat / index.html
Last active March 1, 2024 16:21
Intersection Observer
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Intersection Observer</title>
<link rel="stylesheet" href="style.css">
<script defer src="script.js"></script>
</head>
<body>