From 20d50932769eba91bf1b08cff72f46e08da1e72f Mon Sep 17 00:00:00 2001 From: ludelanier Date: Tue, 14 May 2024 16:48:14 +0200 Subject: [PATCH] fix images --- Dockerfile | 24 +++++++++++++++++------- nginx.conf | 20 ++++++++------------ src/App.vue | 2 -- src/components/GridSkill.vue | 2 +- src/components/HeaderContainer.vue | 2 -- 5 files changed, 26 insertions(+), 24 deletions(-) diff --git a/Dockerfile b/Dockerfile index 25c9459..3f9754c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,19 @@ -FROM node:lts-alpine as builder +# stage1 as builder +FROM node:16-alpine as builder +# Copy the package.json and install dependencies +COPY package*.json ./ +RUN npm install +# Copy rest of the files +COPY . . +# Build the project +RUN npm run build -WORKDIR /app -COPY . ./ -RUN npm install && npm run build -FROM nginx:alpine - -COPY --from=builder /app/dist /usr/share/nginx/html \ No newline at end of file +FROM nginx:alpine as production-build +COPY nginx.conf /etc/nginx/nginx.conf +## Remove default nginx index page +RUN rm -rf /usr/share/nginx/html/* +# Copy from the stage 1 +COPY --from=builder /dist /usr/share/nginx/html/nested-app +EXPOSE 8080 +ENTRYPOINT ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/nginx.conf b/nginx.conf index da8407a..5982179 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,20 +1,16 @@ -worker_processes 1; +worker_processes 4; -events { - worker_connections 1024; -} +events { worker_connections 1024; } http { - include /etc/nginx/mime.types; - server { - listen 8000; - server_name localhost; + listen 8080; + root /usr/share/nginx/html/nested-app; + include /etc/nginx/mime.types; - location / { - root /usr/share/nginx/html; - index index.html; - try_files $uri $uri/ /index.html; + location /nested-app/ { + root /usr/share/nginx/html; + try_files $uri $uri/ /nested-app/index.html; } } } \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 3e212a9..eca6c73 100644 --- a/src/App.vue +++ b/src/App.vue @@ -85,9 +85,7 @@ const progress = ref(0); const visibleTextIndex = ref(0); // Function to check if middle text is visible const checkVisibleTextIndex = () => { - console.log(visibleTextIndex.value) const textElements = document.querySelectorAll('.magic-div > span'); - console.log(textElements)// Selecting all

elements textElements.forEach((element, index) => { const bounding = element.getBoundingClientRect(); // Getting the position of each

element if (bounding.top <= window.innerHeight - 500 && bounding.bottom >= 0) { diff --git a/src/components/GridSkill.vue b/src/components/GridSkill.vue index 1c479dc..c55ec4a 100644 --- a/src/components/GridSkill.vue +++ b/src/components/GridSkill.vue @@ -46,7 +46,7 @@ const skills = [