From 0746ad6bc308bccd3db97e20111dacc83ff6cafc Mon Sep 17 00:00:00 2001
From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com>
Date: Tue, 27 Oct 2020 18:33:22 +0100
Subject: [PATCH] fix: build

---
 Dockerfile     |  2 +-
 nginx/dev.conf | 14 ++++++++++----
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 83be11124..cb392f3b3 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -28,7 +28,7 @@ FROM nginx
 # copy artifact build from the 'build environment'
 RUN apt-get update
 
-COPY --from=build /app/dist/fr /usr/share/nginx/html
+COPY --from=build /app/dist/fr /usr/share/nginx/html/fr
 
 RUN touch /var/run/nginx.pid
 RUN ls -l /usr/share/nginx/html
diff --git a/nginx/dev.conf b/nginx/dev.conf
index 8ebba545b..0ec8e46c4 100644
--- a/nginx/dev.conf
+++ b/nginx/dev.conf
@@ -7,11 +7,17 @@ server {
     # First attempt to serve request as file, then
     # as directory, then fall back to displaying a 404.
     try_files $uri $uri/ /index.html;
+    sub_filter '<html lang="en">' '<html lang="fr">';
   }
 
-  location /api {
-      rewrite ^/api/(.*) /$1 break;
-      proxy_pass http://json-server:3000/api;
-  }
+      # Rule serving the en build
+    location /en {
+        try_files $uri$args /en/index.html;
+    }
+
+    # redirecting the /fr url to the new location of the fr build
+    location ~ ^/fr(.*)$ {
+        return 301 $scheme://$http_host$1$is_args$args;
+    }
 
 }
-- 
GitLab