From aa75e3de794d0097f1aea522fd04421a7111a22c Mon Sep 17 00:00:00 2001 From: ale Date: Tue, 8 Jul 2025 16:17:27 -0300 Subject: [PATCH] Agregado contenedor y configuracion de rutas para vite --- docker-compose.yml | 18 +++++++++++++++++- nginx/conf.d/app.conf | 16 ++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index b68a9d4..6292d8f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3.2' +version: '3.2' services: app: @@ -18,6 +18,22 @@ services: networks: - app-network + vite: + build: + args: + user: www + uid: ${USERID} + context: ./ + container_name: vite + working_dir: /var/www + command: npm run dev + volumes: + - ./:/var/www + ports: + - "5173:5173" + networks: + - app-network + db: image: mysql:5.7 container_name: pedi2-db diff --git a/nginx/conf.d/app.conf b/nginx/conf.d/app.conf index f397fbd..4ed30c8 100644 --- a/nginx/conf.d/app.conf +++ b/nginx/conf.d/app.conf @@ -13,6 +13,22 @@ server { fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; } + location ^~ /@vite/ { + proxy_pass http://vite:5173; + 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; + } + location ^~ /resources/ { + proxy_pass http://vite:5173; + 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; + } location / { try_files $uri $uri/ /index.php?$query_string; gzip_static on;