Merge pull request #91 from rlex/new_dockerfile

New dockerfile
This commit is contained in:
Aykut Saraç 2022-08-19 15:04:12 +03:00 committed by GitHub
commit 33c3e74b49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 12 deletions

View File

@ -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

View File

@ -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]
```

9
default.conf Normal file
View File

@ -0,0 +1,9 @@
server {
listen 8080;
root /app;
include /etc/nginx/mime.types;
location /editor {
try_files $uri /editor.html;
}
}