Commit
This commit is contained in:
30
.local/share/code-server/User/History/2e659bb2/qfRq
Normal file
30
.local/share/code-server/User/History/2e659bb2/qfRq
Normal file
@@ -0,0 +1,30 @@
|
||||
FROM node:18-slim AS combined-build
|
||||
WORKDIR /app
|
||||
|
||||
# Copy and install frontend dependencies
|
||||
COPY frontend/package*.json ./frontend/
|
||||
WORKDIR /app/frontend
|
||||
RUN npm install
|
||||
COPY frontend/ .
|
||||
RUN npm run build
|
||||
|
||||
# Copy frontend build output to /app directory
|
||||
WORKDIR /app
|
||||
RUN mkdir -p /app/public
|
||||
COPY /app/frontend/dist /app/public
|
||||
|
||||
# Setup backend
|
||||
COPY backend/package*.json ./
|
||||
RUN npm install
|
||||
COPY backend/ .
|
||||
|
||||
# Setup Nginx to serve the React App
|
||||
FROM nginx:alpine
|
||||
COPY --from=combined-build /app/public /usr/share/nginx/html
|
||||
|
||||
# Expose ports for frontend and backend
|
||||
EXPOSE 80
|
||||
EXPOSE 3001
|
||||
|
||||
# Run backend and frontend servers
|
||||
CMD ["sh", "-c", "node /app/src/components/server.js & nginx -g 'daemon off;'"]
|
||||
Reference in New Issue
Block a user