From 4d41c2cc7c84f9ff3ee5d409a1bfc66e146d2332 Mon Sep 17 00:00:00 2001 From: Brazing Technology Date: Wed, 29 Apr 2026 11:22:33 +0530 Subject: [PATCH] feat(frontend): add Dockerfile and nginx.conf for ConfigMap --- frontend/Dockerfile | 14 ++++++++++++++ nginx.conf | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 frontend/Dockerfile create mode 100644 nginx.conf diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..583e412 --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,14 @@ +FROM nginx:alpine + +# Static assets +COPY index.html /usr/share/nginx/html/ +COPY style.css /usr/share/nginx/html/ +COPY app.js /usr/share/nginx/html/ + +# nginx.conf is provided at runtime via ConfigMap mount. +# We do NOT copy it into the image; the default nginx.conf in the image +# would be used if the ConfigMap mount is missing. + +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..97189c6 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,38 @@ +worker_processes 1; + +events { + worker_connections 1024; +} + +http { + include mime.types; + default_type application/octet-stream; + sendfile on; + keepalive_timeout 65; + + large_client_header_buffers 4 32k; + + upstream api_backend { + server api:5000; + } + + server { + listen 80; + server_name localhost; + + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } + + location /api/ { + proxy_pass http://api_backend; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + } +}