From a9e652b1c87a48b45e96e079d3c6d83cafaf1bf6 Mon Sep 17 00:00:00 2001 From: Luke Gustafson Date: Wed, 27 Nov 2024 00:13:26 +0000 Subject: [PATCH] Commit --- .../code-server/User/History/2e659bb2/dg9u | 29 ++++++++++++++++ .../User/History/2e659bb2/entries.json | 2 +- .../code-server/User/History/2e659bb2/qz6w | 34 +++++++++++++++++++ .../workspaceStorage/5f040a76/vscode.lock | 2 +- {src => backend/src}/components/server.js | 0 docker/Dockerfile | 24 +++++-------- {src => frontend/src}/App.css | 0 {src => frontend/src}/App.jsx | 0 {src => frontend/src}/index.css | 0 {src => frontend/src}/index.jsx | 0 {src => frontend/src}/logo.svg | 0 {src => frontend/src}/reportWebVitals.js | 0 {src => frontend/src}/setupTests.js | 0 13 files changed, 74 insertions(+), 17 deletions(-) create mode 100644 .local/share/code-server/User/History/2e659bb2/dg9u create mode 100644 .local/share/code-server/User/History/2e659bb2/qz6w rename {src => backend/src}/components/server.js (100%) rename {src => frontend/src}/App.css (100%) rename {src => frontend/src}/App.jsx (100%) rename {src => frontend/src}/index.css (100%) rename {src => frontend/src}/index.jsx (100%) rename {src => frontend/src}/logo.svg (100%) rename {src => frontend/src}/reportWebVitals.js (100%) rename {src => frontend/src}/setupTests.js (100%) diff --git a/.local/share/code-server/User/History/2e659bb2/dg9u b/.local/share/code-server/User/History/2e659bb2/dg9u new file mode 100644 index 00000000..e2c972a0 --- /dev/null +++ b/.local/share/code-server/User/History/2e659bb2/dg9u @@ -0,0 +1,29 @@ +# Stage 1: Build the React app (Frontend) +FROM node:18-slim AS frontend-build +WORKDIR /app + +# Copy frontend files +COPY frontend/package*.json ./frontend/ +WORKDIR /app/frontend +RUN npm install +COPY frontend/ . +RUN npm run build + +# Stage 2: Setup Nginx to serve the React App +FROM nginx:alpine AS frontend-server +COPY --from=frontend-build /app/frontend/dist /usr/share/nginx/html +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] + +# Stage 3: Setup the Backend +FROM node:18-slim AS backend +WORKDIR /app + +# Copy backend files +COPY backend/package*.json ./ +RUN npm install +COPY backend/ . + +# Run backend +EXPOSE 3001 +CMD ["node", "/app/src/components/server.js"] \ No newline at end of file diff --git a/.local/share/code-server/User/History/2e659bb2/entries.json b/.local/share/code-server/User/History/2e659bb2/entries.json index c0a12c29..6c7d1401 100644 --- a/.local/share/code-server/User/History/2e659bb2/entries.json +++ b/.local/share/code-server/User/History/2e659bb2/entries.json @@ -1 +1 @@ -{"version":1,"resource":"vscode-remote://coder.karmaashomepage.online/home/bugattiguy527/docker/Dockerfile","entries":[{"id":"TUF1","timestamp":1732635492973},{"id":"8otg","timestamp":1732635506681},{"id":"XU8z","source":"undoRedo.source","timestamp":1732635515769},{"id":"ars1","timestamp":1732635532917},{"id":"8UPb","timestamp":1732635628577},{"id":"gWeB","timestamp":1732635658901},{"id":"Z5sv","source":"undoRedo.source","timestamp":1732635671649},{"id":"J4VB","timestamp":1732635674581},{"id":"eNc9","timestamp":1732651223530}]} \ No newline at end of file +{"version":1,"resource":"vscode-remote://coder.karmaashomepage.online/home/bugattiguy527/docker/Dockerfile","entries":[{"id":"TUF1","timestamp":1732635492973},{"id":"8otg","timestamp":1732635506681},{"id":"XU8z","source":"undoRedo.source","timestamp":1732635515769},{"id":"ars1","timestamp":1732635532917},{"id":"8UPb","timestamp":1732635628577},{"id":"gWeB","timestamp":1732635658901},{"id":"Z5sv","source":"undoRedo.source","timestamp":1732635671649},{"id":"J4VB","timestamp":1732635674581},{"id":"eNc9","timestamp":1732651223530},{"id":"qz6w","timestamp":1732666102382},{"id":"dg9u","timestamp":1732666385636}]} \ No newline at end of file diff --git a/.local/share/code-server/User/History/2e659bb2/qz6w b/.local/share/code-server/User/History/2e659bb2/qz6w new file mode 100644 index 00000000..d0b0152f --- /dev/null +++ b/.local/share/code-server/User/History/2e659bb2/qz6w @@ -0,0 +1,34 @@ +# Stage 1: Build the React app (Frontend) +FROM node:18-slim AS frontend-build +WORKDIR /app + +# Copy all project files into the image +COPY . . + +# Install dependencies +RUN npm install + +# Build the application +RUN npm run build + +# Stage 2: Setup Nginx to serve the React App +FROM nginx:alpine AS frontend-server + +# Copy built files from builder stage to nginx +COPY --from=frontend-build /app/dist /usr/share/nginx/html +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] + +# Stage 3: Setup the Backend +FROM node:18-slim AS backend +WORKDIR /app + +# Copy package.json and package-lock.json +COPY package*.json ./ + +# Install dependencies +RUN npm install + +# Run backend +EXPOSE 3001 +CMD ["node", "/app/src/components/server.js"] \ No newline at end of file diff --git a/.local/share/code-server/User/workspaceStorage/5f040a76/vscode.lock b/.local/share/code-server/User/workspaceStorage/5f040a76/vscode.lock index 8bde669f..ab4d5563 100644 --- a/.local/share/code-server/User/workspaceStorage/5f040a76/vscode.lock +++ b/.local/share/code-server/User/workspaceStorage/5f040a76/vscode.lock @@ -1 +1 @@ -{"pid":75467,"willReleaseAt":0} \ No newline at end of file +{"pid":136632,"willReleaseAt":0} \ No newline at end of file diff --git a/src/components/server.js b/backend/src/components/server.js similarity index 100% rename from src/components/server.js rename to backend/src/components/server.js diff --git a/docker/Dockerfile b/docker/Dockerfile index 8225e162..e2c972a0 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,20 +2,16 @@ FROM node:18-slim AS frontend-build WORKDIR /app -# Copy all project files into the image -COPY . . - -# Install dependencies +# Copy frontend files +COPY frontend/package*.json ./frontend/ +WORKDIR /app/frontend RUN npm install - -# Build the application +COPY frontend/ . RUN npm run build # Stage 2: Setup Nginx to serve the React App FROM nginx:alpine AS frontend-server - -# Copy built files from builder stage to nginx -COPY --from=frontend-build /app/dist /usr/share/nginx/html +COPY --from=frontend-build /app/frontend/dist /usr/share/nginx/html EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] @@ -23,13 +19,11 @@ CMD ["nginx", "-g", "daemon off;"] FROM node:18-slim AS backend WORKDIR /app -# Copy package.json and package-lock.json -COPY package*.json ./ - -# Install dependencies +# Copy backend files +COPY backend/package*.json ./ RUN npm install +COPY backend/ . -# Copy server.js from its new location -COPY /app/src/components/server.js /app +# Run backend EXPOSE 3001 CMD ["node", "/app/src/components/server.js"] \ No newline at end of file diff --git a/src/App.css b/frontend/src/App.css similarity index 100% rename from src/App.css rename to frontend/src/App.css diff --git a/src/App.jsx b/frontend/src/App.jsx similarity index 100% rename from src/App.jsx rename to frontend/src/App.jsx diff --git a/src/index.css b/frontend/src/index.css similarity index 100% rename from src/index.css rename to frontend/src/index.css diff --git a/src/index.jsx b/frontend/src/index.jsx similarity index 100% rename from src/index.jsx rename to frontend/src/index.jsx diff --git a/src/logo.svg b/frontend/src/logo.svg similarity index 100% rename from src/logo.svg rename to frontend/src/logo.svg diff --git a/src/reportWebVitals.js b/frontend/src/reportWebVitals.js similarity index 100% rename from src/reportWebVitals.js rename to frontend/src/reportWebVitals.js diff --git a/src/setupTests.js b/frontend/src/setupTests.js similarity index 100% rename from src/setupTests.js rename to frontend/src/setupTests.js