This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |