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

Add Dockerfile for WebIDE #123

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:14-alpine

WORKDIR /app

RUN apk update \
&& apk add git \
&& git clone --recursive https://github.com/kaitai-io/kaitai_struct_webide /app \
Comment on lines +6 to +7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I don't understand why are you installing git into the container and then cloning the repo from inside, when this Dockerfile is part of the cloned repository (meaning that the kaitai_struct_webide repo has already been cloned)?

  2. Another problem is that you'll always get the main branch (master) by doing this, which will make it impossible to use this Dockerfile for Web IDE development (like building the image from locally changed files).

    If fetching the remote master branch was your intent, may I ask what's the point of running the Web IDE server with Docker instead of just going to https://ide.kaitai.io/devel/ (or alternatively fetching git clone https://github.com/kaitai-io/ide-kaitai-io.github.io and running a local server in the /devel/ folder).

&& npm install \
&& ./build \
&& npm install -g node-static \
&& apk del --purge git

EXPOSE 8000

CMD static /app/out -p 8000 -a 0.0.0.0
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ Online editor / visualizer for Kaitai Struct .ksy files
- `node serve.js --compile`
- Go to [http://127.0.0.1:8000/](http://127.0.0.1:8000/)

## run locally with Docker

- `git clone https://github.com/kaitai-io/kaitai_struct_webide`
- `docker build -t kaitai_struct_webide .`
- `docker run -i -d -p 8000:8000 kaitai_struct_webide`
- Go to [http://localhost:8000/](http://localhost:8000/)

## screenshots

![Example screenshot of a .zip file](docs/zip_example.png)
Expand Down