Skip to content

Commit

Permalink
Merge pull request #10 from roro89/features/cicd
Browse files Browse the repository at this point in the history
containerization of react app
  • Loading branch information
roro89 authored Jul 18, 2024
2 parents f4ec907 + f8159b6 commit 038ee03
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 634 deletions.
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

0 comments on commit 038ee03

Please sign in to comment.