From 5eebab6f7fc546eb49ca571b947ae4b2a22c62a1 Mon Sep 17 00:00:00 2001 From: Lex Rivera Date: Tue, 16 Aug 2022 17:23:13 +0300 Subject: [PATCH 1/2] dockerfile improvement --- Dockerfile | 15 ++++----------- default.conf | 9 +++++++++ 2 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 default.conf diff --git a/Dockerfile b/Dockerfile index c08154a4c2f..943ed4044ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,11 @@ # Builder FROM node:14-buster as builder - WORKDIR /src - COPY . /src - -RUN npm install --legacy-peer-deps - -RUN npm run build +RUN yarn install --legacy-peer-deps +RUN yarn run build # App -FROM nginx:alpine - +FROM nginxinc/nginx-unprivileged COPY --from=builder /src/out /app - -RUN rm -rf /usr/share/nginx/html \ - && ln -s /app /usr/share/nginx/html +COPY default.conf /etc/nginx/conf.d/default.conf diff --git a/default.conf b/default.conf new file mode 100644 index 00000000000..c97e205521a --- /dev/null +++ b/default.conf @@ -0,0 +1,9 @@ +server { + listen 8080; + root /app; + include /etc/nginx/mime.types; + + location /editor { + try_files $uri /editor.html; + } +} From fa85585e22be1c654d043aae1268d12846e9ef20 Mon Sep 17 00:00:00 2001 From: Lex Rivera Date: Tue, 16 Aug 2022 17:41:23 +0300 Subject: [PATCH 2/2] fix port in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ffa75ab56d..9a0cf70dff2 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ A Docker file is provided in the root of the repository. If you want to run JSON Visio locally: * Build Docker image with `docker build -t jsonvisio .` -* Run locally with `docker run -p 8888:80 jsonvisio` +* Run locally with `docker run -p 8888:8080 jsonvisio` * Go to [http://localhost:8888] ```