Fix Coolify nginx mount issue by baking config into UI image

This commit is contained in:
2026-07-28 13:13:37 +05:30
parent 0aa2372a1d
commit 81350bf2d2
3 changed files with 19 additions and 2 deletions
-2
View File
@@ -29,8 +29,6 @@ services:
build: ./ui build: ./ui
ports: ports:
- "8095:80" - "8095:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
depends_on: depends_on:
- api - api
restart: always restart: always
+1
View File
@@ -9,5 +9,6 @@ RUN npm run build
# Serve stage # Serve stage
FROM nginx:alpine FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80 EXPOSE 80
CMD ["nginx", "-g", "daemon off;"] CMD ["nginx", "-g", "daemon off;"]
+18
View File
@@ -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;
}
}