настройка докер-связи с бэком
This commit is contained in:
1 parent
29f788ed9a
commit
9fc422eb02
6 files changed
+47
-15
No files matched your search
+10
-2
@@ -8,7 +8,7 @@ export default defineConfig({
|
||||
plugins: [
|
||||
react(),
|
||||
Sitemap({
|
||||
hostname: 'https://pvh.projects.rustprogersteam.ru',
|
||||
hostname: process.env.SITE_URL || 'http://localhost:5173',
|
||||
exclude: ['/admin', '/profile'],
|
||||
readable: true,
|
||||
outDir: './dist',
|
||||
@@ -18,12 +18,20 @@ export default defineConfig({
|
||||
server: {
|
||||
host: '0.0.0.0', // Слушаем все интерфейсы
|
||||
port: 5173,
|
||||
allowedHosts: ['pvh.projects.rustprogersteam.ru'],
|
||||
allowedHosts: process.env.VITE_ALLOWED_HOSTS?.split(',').map((host) => host.trim()),
|
||||
strictPort: true, // Запрещаем автоматический выбор порта
|
||||
hmr: {
|
||||
clientPort: 5173, // Важно для HMR в Docker
|
||||
},
|
||||
// Разрешаем CORS для внешних запросов
|
||||
proxy: process.env.VITE_API_PROXY_TARGET
|
||||
? {
|
||||
'/api': {
|
||||
target: process.env.VITE_API_PROXY_TARGET,
|
||||
changeOrigin: true,
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
cors: true
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user