From 81350bf2d29bdc05be5950e4c66dc31f9172892b Mon Sep 17 00:00:00 2001 From: Mohan K Date: Tue, 28 Jul 2026 13:13:37 +0530 Subject: [PATCH] Fix Coolify nginx mount issue by baking config into UI image --- docker-compose.yaml | 2 -- ui/Dockerfile | 1 + ui/nginx.conf | 18 ++++++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 ui/nginx.conf diff --git a/docker-compose.yaml b/docker-compose.yaml index 2e60c2c..f124e3f 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -29,8 +29,6 @@ services: build: ./ui ports: - "8095:80" - volumes: - - ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf depends_on: - api restart: always diff --git a/ui/Dockerfile b/ui/Dockerfile index 42a3def..021f09d 100644 --- a/ui/Dockerfile +++ b/ui/Dockerfile @@ -9,5 +9,6 @@ RUN npm run build # Serve stage FROM nginx: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;"] diff --git a/ui/nginx.conf b/ui/nginx.conf new file mode 100644 index 0000000..bf7ce46 --- /dev/null +++ b/ui/nginx.conf @@ -0,0 +1,18 @@ +server { + listen 80; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html; + } + + location /api/ { + proxy_pass http://api:3000/api/; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; + } +}