From 5e9b8fae67802033f1fa1b84901627adf3366a86 Mon Sep 17 00:00:00 2001 From: Kyllian Chabanon Date: Fri, 4 Apr 2025 15:35:47 +0200 Subject: [PATCH] Modification Dockerfile --- Dockerfile | 1 + nginx.conf | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile index 462810e..74a630f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,3 +9,4 @@ RUN npm run build FROM nginx:1.19-alpine COPY --from=build /app/build /usr/share/nginx/html +COPY nginx.conf /etc/nginx/nginx.conf \ No newline at end of file diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..0bc2600 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,15 @@ +server { + listen 80; + server_name localhost; + + location / { + root /usr/share/nginx/html; + try_files $uri $uri/ /index.html; # Redirige toutes les requêtes non trouvées vers index.html + } + + # Pour servir les fichiers statiques (comme CSS, JS, etc.) + location ~* \.(css|js|json|jpg|jpeg|png|gif|ico)$ { + root /usr/share/nginx/html; + try_files $uri =404; + } +}