From 82eff5e36bacdd72f8a79f6f8b144c98dd8ff881 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C3=ABl=20Bitard?= <bitard.michael@gmail.com>
Date: Mon, 22 May 2023 11:40:59 +0200
Subject: [PATCH] fix(storybook): les storybooks sont de nouveau accessibles
 (#565)

---
 Dockerfile.ui.storybook           |  1 +
 packages/ui/.storybook/preview.ts |  2 +-
 storybook_nginx.conf              | 21 +++++++++++++++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 storybook_nginx.conf

diff --git a/Dockerfile.ui.storybook b/Dockerfile.ui.storybook
index bd0c93a26..3114e0e86 100644
--- a/Dockerfile.ui.storybook
+++ b/Dockerfile.ui.storybook
@@ -1,2 +1,3 @@
 FROM nginx
+ADD storybook_nginx.conf /etc/nginx/templates/default.conf.template
 COPY packages/ui/storybook-static /usr/share/nginx/html
diff --git a/packages/ui/.storybook/preview.ts b/packages/ui/.storybook/preview.ts
index 7d4757c58..c1bea4cff 100644
--- a/packages/ui/.storybook/preview.ts
+++ b/packages/ui/.storybook/preview.ts
@@ -16,7 +16,7 @@ setup(app => {
 export const decorators: Decorator[] = [
   story => ({
     components: { story, IconSprite },
-    template: '<div style="margin: 3em;"><IconSprite /><story /></div>',
+    template: '<div class="page">' + '<main class="main">' + '<div class="container"><IconSprite /><story /></div>' + '</main>' + '</div>',
   }),
 ]
 
diff --git a/storybook_nginx.conf b/storybook_nginx.conf
new file mode 100644
index 000000000..e85ac90d3
--- /dev/null
+++ b/storybook_nginx.conf
@@ -0,0 +1,21 @@
+server {
+    listen       80;
+    listen  [::]:80;
+    server_name  localhost;
+
+    include mime.types;
+    types
+    {
+        application/javascript mjs;
+    }
+
+    location / {
+        root   /usr/share/nginx/html;
+        index  index.html index.htm;
+    }
+
+    error_page   500 502 503 504  /50x.html;
+    location = /50x.html {
+        root   /usr/share/nginx/html;
+    }
+}
\ No newline at end of file
-- 
GitLab