updated Dockerfile build process

This commit is contained in:
2025-01-01 10:43:59 +02:00
parent 0abc6ce6e5
commit 2f61020cdc
3 changed files with 14 additions and 7 deletions

View File

@ -3,19 +3,27 @@ FROM node:20 AS build
WORKDIR /app WORKDIR /app
COPY package.json ./ # Copy package.json and package-lock.json to the WORKDIR
COPY package-lock.json ./ COPY frontend/package.json ./
COPY frontend/package-lock.json ./
# Install dependencies
RUN npm install RUN npm install
COPY . ./ # Copy the rest of the frontend files to the WORKDIR
COPY frontend/. ./
# Build the React app
RUN npm run build RUN npm run build
# Step 2: Serve the app # Step 2: Serve the app
FROM nginx:alpine FROM nginx:alpine
# Copy the built files from the build stage to the Nginx web root
COPY --from=build /app/dist /usr/share/nginx/html COPY --from=build /app/dist /usr/share/nginx/html
# Expose port 80 # Expose port 80
EXPOSE 80 EXPOSE 80
CMD ["nginx", "-g", "daemon off;"] # Run Nginx in the foreground
CMD ["nginx", "-g", "daemon off;"]

View File

@ -18,7 +18,7 @@ const Footer = () => {
<span>Built with React & Tailwind CSS</span> <span>Built with React & Tailwind CSS</span>
<span></span> <span></span>
<a <a
href="https://github.com/TheTaqiTahmid/portfolio" href="https://github.com/TheTaqiTahmid/my-portfolio.git"
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
className="hover:text-blue-600 dark:hover:text-blue-400 transition-colors" className="hover:text-blue-600 dark:hover:text-blue-400 transition-colors"

View File

@ -1,4 +1,3 @@
import React from "react";
import { Linkedin, Github, Award } from "lucide-react"; import { Linkedin, Github, Award } from "lucide-react";
const Introduction = () => { const Introduction = () => {
@ -72,4 +71,4 @@ const Introduction = () => {
); );
}; };
export default Introduction; export default Introduction;