Compare commits

6 Commits

Author SHA1 Message Date
3d42e156a2 updates 2026-06-11 21:29:16 +05:30
c8e51a188c updates on the build file 2026-06-11 21:27:09 +05:30
6f5f3d50d3 Update Dockerfile 2026-06-11 15:50:10 +00:00
9dfcea815e Update nginx.config 2026-06-11 15:49:54 +00:00
4c52ef780d Add nginx.config 2026-06-11 15:49:39 +00:00
4dd326fa38 Add Dockerfile 2026-06-11 15:48:50 +00:00
2 changed files with 43 additions and 0 deletions

26
Dockerfile Normal file
View File

@@ -0,0 +1,26 @@
# Stage 1: Build the React application
FROM node:20-alpine AS build
WORKDIR /app
# Copy lock files and install dependencies
COPY package*.json yarn.lock* package-lock.json* ./
RUN npm install
# Copy codebase and compile Vite project
COPY . .
RUN npm run build
# Stage 2: Serve using Nginx
FROM nginx:alpine
# Copy custom Nginx configuration
COPY nginx.config /etc/nginx/nginx.conf
# Copy Vite's dist output from Stage 1 to Nginx default html path
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 3000
CMD ["nginx", "-g", "daemon off;"]

17
nginx.config Normal file
View File

@@ -0,0 +1,17 @@
events {}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
server {
listen 3000;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
}
}