Config: Adaptation frontend pour déploiement serveur

- Dockerfile optimisé avec build multi-stage
- Configuration nginx pour ynov.ptits-pas.fr
- Correction URL API: supernounou.local → ynov.ptits-pas.fr/api
- Support SPA avec try_files pour Flutter routing
This commit is contained in:
ynov-deploy 2025-08-21 23:55:43 +02:00
parent 2a9883a149
commit 4caec0a104
3 changed files with 30 additions and 1 deletions

16
frontend/Dockerfile Normal file
View File

@ -0,0 +1,16 @@
# Stage builder
FROM cirrusci/flutter:stable AS builder
WORKDIR /app
COPY pubspec.* ./
RUN flutter pub get
COPY . .
RUN flutter build web --release
# Stage production
FROM nginx:alpine
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/build/web /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

View File

@ -2,7 +2,7 @@ import 'package:http/http.dart' as http;
import 'dart:convert';
class BugReportService {
static const String _apiUrl = 'https://api.supernounou.local/bug-reports';
static const String _apiUrl = 'https://ynov.ptits-pas.fr/api/bug-reports';
static Future<void> sendReport(String description) async {
try {

13
frontend/nginx.conf Normal file
View File

@ -0,0 +1,13 @@
server {
listen 80;
server_name ynov.ptits-pas.fr;
location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}
# Gestion des erreurs
error_page 404 /index.html;
}