diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..96a7768 --- /dev/null +++ b/frontend/Dockerfile @@ -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;"] diff --git a/frontend/lib/services/bug_report_service.dart b/frontend/lib/services/bug_report_service.dart index 7dc9af4..69a0bf5 100644 --- a/frontend/lib/services/bug_report_service.dart +++ b/frontend/lib/services/bug_report_service.dart @@ -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 sendReport(String description) async { try { diff --git a/frontend/nginx.conf b/frontend/nginx.conf new file mode 100644 index 0000000..29d7e49 --- /dev/null +++ b/frontend/nginx.conf @@ -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; +}