File tree Expand file tree Collapse file tree 5 files changed +653
-590
lines changed Expand file tree Collapse file tree 5 files changed +653
-590
lines changed Original file line number Diff line number Diff line change 1+ .env
2+ .env.local
3+ .env.development
4+ .env.production
5+ .env.test
6+ .env.test.local
7+ node_modules
8+ dist
9+ .vscode
10+ .idea
Original file line number Diff line number Diff line change 1+ FROM node:22-alpine AS node
2+
3+ FROM node AS builder
4+ ARG VITE_API_URL
5+ WORKDIR /builder
6+ ENV NODE_ENV=production
7+ COPY . .
8+
9+ RUN npm install
10+ RUN npm run build
11+
12+ FROM nginx:alpine AS runner
13+ WORKDIR /app
14+
15+ # Create custom nginx.conf
16+ RUN echo $'\
17+ server {\n \
18+ listen 80;\n \
19+ location / {\n \
20+ root /usr/share/nginx/html;\n \
21+ index index.html;\n \
22+ try_files $uri $uri/ /index.html;\n \
23+ }\n \
24+ }' > /etc/nginx/conf.d/default.conf
25+
26+ COPY --from=builder /builder/dist /usr/share/nginx/html
Original file line number Diff line number Diff line change 11# Project Overview
2- This project is built using Vite and React.
2+
3+ This project is built using Vite and React.
34
45# Deployed Radar Diagram
56
@@ -10,17 +11,47 @@ The radar is customizable. You can also add additional rings and divide the rada
1011The radar uses the [ radar-diagram] ( https://www.npmjs.com/package/radar-diagram ) library.
1112
1213## Prerequisitions:
13- * nodejs v18
14+
15+ - nodejs v18
1416
1517## Installation
1618
17191 . To install all the necessary dependencies, run the following command:
1820
1921` npm install `
2022
21-
2223## Running the Project
24+
23252 . To start the development server, use the following command:
2426
2527` npm run dev `
2628
29+ ## Production setup
30+
31+ 1 . Build project image
32+
33+ via package.json script
34+
35+ ``` sh
36+ npm run image:build
37+ ```
38+
39+ or directly running docker
40+
41+ ``` sh
42+ docker build -t frontend-radar:latest .
43+ ```
44+
45+ 2 . Run the production image
46+
47+ via package.json script, runs on port 8080
48+
49+ ``` sh
50+ npm run image:run
51+ ```
52+
53+ or directly running docker
54+
55+ ``` sh
56+ docker run -p 8080:80 --rm frontend-radar:latest
57+ ```
You can’t perform that action at this time.
0 commit comments