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
COPY package.json ./
COPY package-lock.json ./
# Copy package.json and package-lock.json to the WORKDIR
COPY frontend/package.json ./
COPY frontend/package-lock.json ./
# Install dependencies
RUN npm install
COPY . ./
# Copy the rest of the frontend files to the WORKDIR
COPY frontend/. ./
# Build the React app
RUN npm run build
# Step 2: Serve the app
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
# Expose port 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></span>
<a
href="https://github.com/TheTaqiTahmid/portfolio"
href="https://github.com/TheTaqiTahmid/my-portfolio.git"
target="_blank"
rel="noreferrer"
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";
const Introduction = () => {
@ -72,4 +71,4 @@ const Introduction = () => {
);
};
export default Introduction;
export default Introduction;