From a2e165fa851c951e8730e8c17e9505a6ad081677 Mon Sep 17 00:00:00 2001 From: Ahmed Nour Eldin Date: Mon, 18 Jul 2022 03:22:47 +0200 Subject: [PATCH 1/6] create environment variables --- .env | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000..7e3d4a3 --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +DIRECTORY= ~/space +PORT=3000 \ No newline at end of file From 61625772795238337d6181b1ec7a31160ee2080b Mon Sep 17 00:00:00 2001 From: Ahmed Nour Eldin Date: Mon, 18 Jul 2022 03:23:27 +0200 Subject: [PATCH 2/6] create dockerfile --- Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b672517 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM node:slim + +RUN mkdir /space +RUN chown node:node /space +USER node +WORKDIR /space + +EXPOSE 3000 + +CMD ["sh","-c","npx --yes @silverbulletmd/server --port 3000 /space"] \ No newline at end of file From d6398d7d89c9fee0e40ad2f6f8855d2d76ef84ff Mon Sep 17 00:00:00 2001 From: Ahmed Nour Eldin Date: Mon, 18 Jul 2022 03:24:51 +0200 Subject: [PATCH 3/6] create docker compose --- docker-compose.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 docker-compose.yaml diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..4ff35c7 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + sb: + build: ./ + image: sb + container_name: sb + ports: + - ${PORT}:3000 + volumes: + - type: bind + source: ${DIRECTORY} + target: /space \ No newline at end of file From d56f1b87d3593815ad86201bf3ddef0ffd735d91 Mon Sep 17 00:00:00 2001 From: Ahmed Nour Eldin Date: Mon, 18 Jul 2022 03:32:08 +0200 Subject: [PATCH 4/6] add docker setup --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 78d79f7..34b5e21 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,22 @@ More documentation can be found in the [docs space](https://github.com/zefhemel/ * **Extensible** through plugs. ## Installing and running Silver Bullet + +## Start with docker +First you have to clone the repo, then configure your port, space/directory in .env file + +then run +``` +docker compose up +``` +then open your browser and ROCK! + +e.g. +``` +localhost:PORT +``` + +## Start without docker To run a release version, you need to have a recent version of npm (8+) and node.js (16+) installed as well as some basic build infrastructure (make, cpp). Silver Bullet has only been tested on MacOS and Linux thus far. To install and run, create a folder for your pages (can be empty or an existing folder with `.md` files) and run: From d7dc914d98a1a235509338337984c98551d2c3e4 Mon Sep 17 00:00:00 2001 From: Ahmed Nour Eldin Date: Mon, 18 Jul 2022 19:48:19 +0200 Subject: [PATCH 5/6] Update Dockerfile --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index b672517..2539beb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,12 @@ -FROM node:slim +FROM node:18.6.0-slim RUN mkdir /space RUN chown node:node /space USER node WORKDIR /space +RUN npx --yes @silverbulletmd/server || true + EXPOSE 3000 -CMD ["sh","-c","npx --yes @silverbulletmd/server --port 3000 /space"] \ No newline at end of file +CMD ["sh","-c","npx --yes @silverbulletmd/server --port 3000 /space"] From a6a80e8171b16f752f33842341c7fbc571cfccc4 Mon Sep 17 00:00:00 2001 From: Ahmed Nour Eldin Date: Mon, 18 Jul 2022 19:48:58 +0200 Subject: [PATCH 6/6] Update .env --- .env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 7e3d4a3..9c4c53c 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ -DIRECTORY= ~/space -PORT=3000 \ No newline at end of file +DIRECTORY= +PORT=3000