diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..be683f272 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM node:16 +RUN apt-get update -y && \ + apt-get install cmake xvfb jq curl sudo fswatch git g++ -y && \ + rm -rf /var/lib/apt/lists/* +COPY --chown=root:root scripts/ci/prepare_linux.sh /usr/sbin/ +RUN export DEBIAN_FRONTEND=noninteractive +RUN sudo npm install --global yarn +RUN yarn + +RUN groupadd --gid 1000 datastation \ + && useradd --home-dir /home/datastation --create-home --uid 1000 \ + --gid 1000 --shell /bin/bash --skel /dev/null datastation +USER datastation diff --git a/HACKING.md b/HACKING.md index 6b3fcacdf..14b34479f 100644 --- a/HACKING.md +++ b/HACKING.md @@ -27,6 +27,14 @@ yarn build-ui And manually start a web-server: `python3 -m http.server --port 8080 build`. +### Via Docker + +To build and run the in-browser application via `docker` and `docker-compose`: + +``` +docker-compose -f docker-compose-browser.yml build +docker-compose -f docker-compose-browser.yml up +``` ## Build and run the desktop app diff --git a/docker-compose-browser.yml b/docker-compose-browser.yml new file mode 100644 index 000000000..a2df05cb9 --- /dev/null +++ b/docker-compose-browser.yml @@ -0,0 +1,11 @@ +version: "3.9" +services: + datastation: + image: datastation:latest + build: . + ports: + - "8080:8080" + volumes: + - ./:/home/datastation/datastation:Z + entrypoint: "sh -c" + command: ["cd ~/datastation && yarn && yarn start-ui"]