Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New dockerfile #91

Merged
merged 2 commits into from
Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
```

Expand Down
9 changes: 9 additions & 0 deletions default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
server {
listen 8080;
root /app;
include /etc/nginx/mime.types;

location /editor {
try_files $uri /editor.html;
}
}