Skip to content
Open
34 changes: 6 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,7 @@
# Step 1: Build the React app
FROM node:20 AS build
# - Comment, ignored by docker
# - Docker Directives/intsructions will be in UPPER CASE
# FROM -> used for specifying base image
FROM nginx

# Set working directory
WORKDIR /app

# Copy package.json and package-lock.json
COPY package.json package-lock.json ./

# Install dependencies
RUN npm install

# Copy the rest of the application files
COPY . .

# Build the app for production
RUN npm run build

# Step 2: Set up the production server with Nginx
FROM nginx:alpine

# Copy the build output to Nginx's public directory
COPY --from=build /app/build /usr/share/nginx/html

# Expose port 80
EXPOSE 80

# Start Nginx
CMD ["nginx", "-g", "daemon off;"]
#COPY -> USED FOR COPYING FILES FROM HOST to YOUR CUSTOM IMAGE
COPY . /usr/share/nginx/html
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lms-react",
"version": "1.1",
"name": "QUEEN",
"version": "4.5",
"private": true,
"dependencies": {
"@testing-library/dom": "^10.4.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/FrontPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const FrontPage = () => {
return (
<div className="login-page">
<div className="login-left">
<h1 className="brand-name">Edu Learn</h1>
<h1 className="brand-name">QUEEN</h1>
<div className="login-card">
<form className="login-form" onSubmit={handleLogin}>
<label>Username</label>
Expand Down