From eeaf45defecf2472589d343126c794fc6581e826 Mon Sep 17 00:00:00 2001 From: Edwin Eames Date: Sat, 16 Aug 2025 21:52:09 -0400 Subject: [PATCH] website online working --- .gitignore | 2 +- Dockerfile => Dockerfile.dev | 3 --- Dockerfile.local | 28 ++++++++++++++++++++++++++++ Dockerfile.prod | 8 ++++---- 4 files changed, 33 insertions(+), 8 deletions(-) rename Dockerfile => Dockerfile.dev (86%) create mode 100644 Dockerfile.local diff --git a/.gitignore b/.gitignore index a75f163..f369ed6 100755 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,7 @@ lerna-debug.log* node_modules dist dist-ssr -*.local + # Editor directories and files .vscode/* diff --git a/Dockerfile b/Dockerfile.dev similarity index 86% rename from Dockerfile rename to Dockerfile.dev index a2ceaa5..51973cd 100755 --- a/Dockerfile +++ b/Dockerfile.dev @@ -3,7 +3,6 @@ FROM node:20.11.1 ENV VITE_BASE_URL="http://localhost:9510" ENV VITE_AUTO_URL="http://localhost:9514" ENV VITE_MONEY_URL="http://localhost:9513" -ENV VITE_PRINT_URL="http://localhost:9512" ENV VITE_COMPANY_ID='1' @@ -17,6 +16,4 @@ ENV PATH /app/node_modules/.bin:$PATH RUN npm install - - COPY . /app \ No newline at end of file diff --git a/Dockerfile.local b/Dockerfile.local new file mode 100644 index 0000000..1c565e6 --- /dev/null +++ b/Dockerfile.local @@ -0,0 +1,28 @@ +FROM node:20.11.1 AS builder + +ENV VITE_BASE_URL="http://192.168.1.204:9610" +ENV VITE_AUTO_URL="http://192.168.1.204:9614" +ENV VITE_MONEY_URL="http://192.168.1.204:9613" + +ENV VITE_COMPANY_ID='1' + +WORKDIR /app +COPY package*.json . +RUN npm ci +COPY . . +RUN npm run build +RUN npm prune --production + + + + +FROM nginx:stable-alpine as production-stage +ENV NODE_ENV=production +# Copy the build application from the previous stage to the Nginx container +COPY --from=builder /app/dist /usr/share/nginx/html +# Copy the nginx configuration file +COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf +# Expose the port 80 +EXPOSE 80 +# Start Nginx to serve the application +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/Dockerfile.prod b/Dockerfile.prod index cacfa7f..32ef3d5 100644 --- a/Dockerfile.prod +++ b/Dockerfile.prod @@ -3,10 +3,10 @@ FROM node:20.11.1 AS builder -ENV VITE_BASE_URL="http://192.168.1.204:9510" -ENV VITE_PRINT_URL="http://192.168.1.204:9512" -ENV VITE_MONEY_URL="http://192.168.1.204:9513" -ENV VITE_AUTO_URL="http://192.168.1.204:9514" +ENV VITE_BASE_URL="https://apioil.edwineames.com" +ENV VITE_MONEY_URL="https://apimoney.edwineames.com" +ENV VITE_AUTO_URL="https://apiauto.edwineames.com" + ENV VITE_COMPANY_ID="1" ENV NODE_ENV=production