-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from DioCrafts/feature/frontend-helm-chart
fix frontend
- Loading branch information
Showing
13 changed files
with
165 additions
and
26 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,32 @@ | ||
# Etapa 1: Construcción de los archivos estáticos | ||
FROM node:18-alpine AS builder | ||
|
||
# Establece el directorio de trabajo | ||
WORKDIR /app | ||
|
||
# Copia los archivos necesarios para instalar las dependencias | ||
COPY package.json package-lock.json ./ | ||
|
||
# Instala las dependencias del proyecto | ||
RUN npm install | ||
|
||
# Copia el código fuente al contenedor | ||
COPY . . | ||
|
||
# Construye los archivos estáticos con Vite | ||
RUN npm run build | ||
|
||
# Etapa 2: Servidor Nginx para los archivos estáticos | ||
# Etapa 2: Servidor Nginx para servir los archivos estáticos | ||
FROM nginx:stable-alpine | ||
|
||
# Copia los archivos estáticos generados a la carpeta predeterminada de Nginx | ||
COPY --from=builder /app/dist /usr/share/nginx/html | ||
|
||
# Copia la configuración personalizada de Nginx (si existe) | ||
COPY nginx.conf /etc/nginx/conf.d/default.conf | ||
|
||
# Expone el puerto 80 para el tráfico HTTP | ||
EXPOSE 80 | ||
|
||
# Inicia Nginx en modo foreground | ||
CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
server { | ||
listen 80; | ||
|
||
# Sirve los archivos estáticos del frontend | ||
location / { | ||
root /usr/share/nginx/html; # Ruta donde están los archivos generados (dist/) | ||
index index.html; | ||
try_files $uri /index.html; # Asegura que las rutas SPA funcionen | ||
} | ||
|
||
# Proxy para las llamadas a la API | ||
location /api/ { | ||
proxy_pass http://flusso-api-gateway-api-gateway.default.svc.cluster.local:8081; | ||
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
import { defineConfig } from 'vite'; | ||
import react from '@vitejs/plugin-react'; | ||
|
||
|
||
export default defineConfig({ | ||
root: './', // Adjust this path to point to where your `index.html` is located | ||
root: './', | ||
plugins: [react()], | ||
server: { | ||
host: true, // Permite conexiones externas | ||
port: 5173, // Cambia si hay conflictos de puertos | ||
open: true, // Abre el navegador automáticamente | ||
host: true, | ||
port: 8080, | ||
open: true, | ||
proxy: { | ||
'/api': 'http://flusso-api-gateway-api-gateway.default.svc.cluster.local:8081', // Redirige las solicitudes al API REST en Kubernetes | ||
'/api': { | ||
target: 'http://flusso-api-gateway-api-gateway.default.svc.cluster.local:8081', // URL del backend interno | ||
changeOrigin: true, | ||
}, | ||
}, | ||
}, | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters