feat: prepare production environment and fix frontend build
- Create .env file with production configuration for local testing. - Fix frontend compilation errors: - Correct import paths for `useToast` hook in `WebhooksPage.tsx` and `AdminDashboardPage.tsx`. - Update `WebhooksPage.tsx` to use the existing custom `Dialog` component API. - Improve Nginx configuration in `apps/web/nginx.conf`: - Use resolver and variables for upstream proxies to prevent crash when backend services are down. - Fix stream server proxy path to route `/stream` to `/ws` as expected by the backend. - Update `docker-compose.production.yml` to use correct `Dockerfile` name for stream server.
This commit is contained in:
parent
23270b056a
commit
c605f84183
4 changed files with 28 additions and 31 deletions
|
|
@ -4,6 +4,8 @@ server {
|
|||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
resolver 127.0.0.11 valid=30s;
|
||||
|
||||
# Gzip compression
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
|
|
@ -46,7 +48,8 @@ server {
|
|||
|
||||
# API proxy (if needed)
|
||||
location /api {
|
||||
proxy_pass http://backend-api:8080;
|
||||
set $backend_api backend-api;
|
||||
proxy_pass http://$backend_api:8080;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
|
|
@ -59,7 +62,8 @@ server {
|
|||
|
||||
# WebSocket proxy (if needed)
|
||||
location /ws {
|
||||
proxy_pass http://chat-server:8081;
|
||||
set $chat_server chat-server;
|
||||
proxy_pass http://$chat_server:8081;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
|
|
@ -72,7 +76,8 @@ server {
|
|||
|
||||
# Stream WebSocket proxy (if needed)
|
||||
location /stream {
|
||||
proxy_pass http://stream-server:8082;
|
||||
set $stream_server stream-server;
|
||||
proxy_pass http://$stream_server:8082/ws;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import {
|
|||
} from '@/features/admin/api/auditService';
|
||||
import { apiClient } from '@/services/api/client';
|
||||
import { LoadingSpinner } from '@/components/ui/loading-spinner';
|
||||
import { useToast } from '@/hooks/use-toast';
|
||||
import { useToast } from '@/hooks/useToast';
|
||||
import { formatDistanceToNow } from 'date-fns';
|
||||
import { fr } from 'date-fns/locale';
|
||||
import { Pagination } from '@/components/navigation/Pagination';
|
||||
|
|
|
|||
|
|
@ -11,11 +11,6 @@ import { Input } from '@/components/ui/input';
|
|||
import { Label } from '@/components/ui/label';
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
DialogTrigger,
|
||||
} from '@/components/ui/dialog';
|
||||
import { ConfirmationDialog } from '@/components/ui/confirmation-dialog';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
|
|
@ -40,7 +35,7 @@ import {
|
|||
} from '@/features/webhooks/api/webhookApi';
|
||||
import { Webhook } from '@/types/webhook';
|
||||
import { LoadingSpinner } from '@/components/ui/loading-spinner';
|
||||
import { useToast } from '@/hooks/use-toast';
|
||||
import { useToast } from '@/hooks/useToast';
|
||||
|
||||
/**
|
||||
* FE-PAGE-016: Webhooks management page
|
||||
|
|
@ -212,26 +207,23 @@ export function WebhooksPage() {
|
|||
Gérez vos webhooks pour recevoir des notifications en temps réel
|
||||
</p>
|
||||
</div>
|
||||
<Dialog open={isCreateDialogOpen} onOpenChange={setIsCreateDialogOpen}>
|
||||
<DialogTrigger asChild>
|
||||
<Button>
|
||||
<Plus className="h-4 w-4 mr-2" />
|
||||
Créer un webhook
|
||||
</Button>
|
||||
</DialogTrigger>
|
||||
<DialogContent className="max-w-2xl">
|
||||
<DialogHeader>
|
||||
<DialogTitle>Créer un nouveau webhook</DialogTitle>
|
||||
<DialogDescription>
|
||||
Configurez un webhook pour recevoir des notifications d'événements
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<CreateWebhookForm
|
||||
onSubmit={handleCreateWebhook}
|
||||
availableEvents={availableEvents}
|
||||
onCancel={() => setIsCreateDialogOpen(false)}
|
||||
/>
|
||||
</DialogContent>
|
||||
<Button onClick={() => setIsCreateDialogOpen(true)}>
|
||||
<Plus className="h-4 w-4 mr-2" />
|
||||
Créer un webhook
|
||||
</Button>
|
||||
<Dialog
|
||||
open={isCreateDialogOpen}
|
||||
onClose={() => setIsCreateDialogOpen(false)}
|
||||
title="Créer un nouveau webhook"
|
||||
>
|
||||
<div className="text-sm text-muted-foreground mb-4">
|
||||
Configurez un webhook pour recevoir des notifications d'événements
|
||||
</div>
|
||||
<CreateWebhookForm
|
||||
onSubmit={handleCreateWebhook}
|
||||
availableEvents={availableEvents}
|
||||
onCancel={() => setIsCreateDialogOpen(false)}
|
||||
/>
|
||||
</Dialog>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ services:
|
|||
container_name: veza-stream-server-prod
|
||||
build:
|
||||
context: ./veza-stream-server
|
||||
dockerfile: Dockerfile.stream
|
||||
dockerfile: Dockerfile
|
||||
environment:
|
||||
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?sslmode=disable
|
||||
REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379
|
||||
|
|
|
|||
Loading…
Reference in a new issue