From a0ca74cb18aeb6255e736850b332ba8779450fa0 Mon Sep 17 00:00:00 2001 From: Suriya Date: Tue, 26 May 2026 09:54:30 +0530 Subject: [PATCH] Update Dockerfile and nginx.conf for Dokploy deployment --- Dockerfile | 18 ++++++++++++++++++ nginx.conf | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 Dockerfile create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d04ccdf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM nginx:alpine + +# Move to Nginx's public folder +WORKDIR /usr/share/nginx/html + +# 1. CRUCIAL: Remove Nginx's default "Welcome" page files completely +RUN rm -rf ./* + +# 2. Copy your compiled static assets into the root folder. +# NOTE: If your folder is named "dist" instead of "build", change "build/" to "dist/" +COPY build/ . + +# 3. Copy your custom Nginx configuration (which you already have in your log) +COPY nginx.conf /etc/nginx/nginx.conf + +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..f1a121b --- /dev/null +++ b/nginx.conf @@ -0,0 +1,18 @@ +events {} + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + server { + listen 80; + server_name localhost; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + # This line forces Nginx to pass routing back to React Router + try_files $uri $uri/ /index.html; + } + } +}