Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

containerization of react app #10

Merged
merged 17 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ jobs:
image: finshark/finsharp-app
registry: gcr.io
dockerfile: ./frontend/Dockerfile
directory: ./frontend
username: _json_key
password: ${{ secrets.GCP_SA_KEY }}
11 changes: 8 additions & 3 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
FROM node:21-alpine

WORKDIR /app
COPY package*.json ./

COPY package*.json ./
RUN npm install

COPY . .

EXPOSE 5173
CMD ["npm", "run"]
RUN npm run build

EXPOSE 3000
ENV NODE_ENV=development

CMD ["npm", "start"]
26 changes: 23 additions & 3 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
]
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@types/axios": "^0.14.0",
"@types/uuid": "^9.0.8",
"tailwindcss": "^3.4.4"
Expand Down
24 changes: 12 additions & 12 deletions frontend/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import { searchCompanies } from './api';
import { RouterProvider } from 'react-router-dom';
import { router } from './Routes/Routes';
import React from "react";
import ReactDOM from "react-dom/client";
import { RouterProvider } from "react-router-dom";
import "./index.css";
import App from "./App";
import reportWebVitals from "./reportWebVitals";
import { router } from "./Routes/Routes";

const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
document.getElementById("root") as HTMLElement
);
console.log(searchCompanies("tsla"));

//console.log(searchCompanies("tsla"));
root.render(
<React.StrictMode>
<RouterProvider router={router}/>
<RouterProvider router={router} />
</React.StrictMode>
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
reportWebVitals();
Loading
Loading