docker set up
This commit is contained in:
23
frontend/Dockerfile
Normal file
23
frontend/Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
||||
FROM node:22-alpine AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json ./
|
||||
|
||||
RUN npm install
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN npm run build
|
||||
|
||||
# ------------------------
|
||||
|
||||
FROM nginx:stable-alpine
|
||||
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
11
frontend/nginx.conf
Normal file
11
frontend/nginx.conf
Normal file
@@ -0,0 +1,11 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
6
frontend/package-lock.json
generated
6
frontend/package-lock.json
generated
@@ -2212,9 +2212,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001695",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001695.tgz",
|
||||
"integrity": "sha512-vHyLade6wTgI2u1ec3WQBxv+2BrTERV28UXQu9LO6lZ9pYeMk34vjXFLOxo1A4UBA8XTL4njRQZdno/yYaSmWw==",
|
||||
"version": "1.0.30001731",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001731.tgz",
|
||||
"integrity": "sha512-lDdp2/wrOmTRWuoB5DpfNkC0rJDU8DqRa6nYL6HK6sytw70QMopt/NIc/9SM7ylItlBWfACXk0tEn37UWM/+mg==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
|
||||
@@ -6,6 +6,8 @@ import * as yup from "yup";
|
||||
import Input from "../../ApplicationForm/Input";
|
||||
import axios from "axios";
|
||||
|
||||
const BASE_URL = import.meta.env.VITE_API_BASE_URL;
|
||||
|
||||
function FilterDataForm({ setReportData, setLoading }) {
|
||||
const { role, user } = useRouteLoaderData("Validator-Root")?.data;
|
||||
|
||||
@@ -83,13 +85,13 @@ function FilterDataForm({ setReportData, setLoading }) {
|
||||
if (applicationType) queryParams.append("applicationType", applicationType);
|
||||
|
||||
const res = await axios.get(
|
||||
`http://localhost:3000/validator/getReportData?${queryParams.toString()}`,
|
||||
{
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
withCredentials: true,
|
||||
}
|
||||
`${BASE_URL}/validator/getReportData?${queryParams.toString()}`,
|
||||
{
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
withCredentials: true,
|
||||
}
|
||||
);
|
||||
setReportData({data: res.data, query: values});
|
||||
} catch (error) {
|
||||
|
||||
@@ -19,7 +19,7 @@ import ChartDataLabels from 'chartjs-plugin-datalabels';
|
||||
import Table from "./Table";
|
||||
import { PDFDownloadLink, PDFViewer } from "@react-pdf/renderer";
|
||||
import ApprovalVsRejectionTrends from "./map";
|
||||
import ReportPDF from "./reportPDF";
|
||||
import ReportPDF from "./ReportPDF";
|
||||
|
||||
// Register chart components for all three types (Line, Bar, Pie)
|
||||
ChartJS.register(
|
||||
|
||||
@@ -13,6 +13,6 @@ export default defineConfig({
|
||||
'/submit': process.env.VITE_APP_API_URL,
|
||||
},
|
||||
host: true,
|
||||
port: 5173,
|
||||
port: process.env.VITE_APP_PORT,
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user