Commit
This commit is contained in:
35
.local/share/code-server/User/History/-2ee20f0b/abiG
Normal file
35
.local/share/code-server/User/History/-2ee20f0b/abiG
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# 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
|
||||||
|
|
||||||
|
# Copy server.js from its new location
|
||||||
|
COPY /home/bugattiguy527/src/components/server.js /app/src/components
|
||||||
|
EXPOSE 3001
|
||||||
|
CMD ["node", "server.js"]
|
||||||
@@ -1 +1 @@
|
|||||||
{"version":1,"resource":"vscode-remote://coder.karmaashomepage.online/home/bugattiguy527/Dockerfile","entries":[{"id":"UqhJ","timestamp":1732636530341},{"id":"obRf","timestamp":1732636548561}]}
|
{"version":1,"resource":"vscode-remote://coder.karmaashomepage.online/home/bugattiguy527/Dockerfile","entries":[{"id":"UqhJ","timestamp":1732636530341},{"id":"obRf","timestamp":1732636548561},{"id":"abiG","timestamp":1732636571673},{"id":"nkvD","timestamp":1732636588673}]}
|
||||||
35
.local/share/code-server/User/History/-2ee20f0b/nkvD
Normal file
35
.local/share/code-server/User/History/-2ee20f0b/nkvD
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# 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
|
||||||
|
|
||||||
|
# Copy server.js from its new location
|
||||||
|
COPY /app/src/components/server.js /app/src/components
|
||||||
|
EXPOSE 3001
|
||||||
|
CMD ["node", "server.js"]
|
||||||
@@ -30,6 +30,6 @@ COPY package*.json ./
|
|||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
# Copy server.js from its new location
|
# Copy server.js from its new location
|
||||||
COPY /home/bugattiguy527/src/components/server.js /app/src/components
|
COPY /app/src/components/server.js /app/src/components
|
||||||
EXPOSE 3001
|
EXPOSE 3001
|
||||||
CMD ["node", "server.js"]
|
CMD ["node", "server.js"]
|
||||||
Reference in New Issue
Block a user