diff --git a/.env b/.env new file mode 100644 index 00000000..9c4c53cd --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +DIRECTORY= +PORT=3000 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..2539beb4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +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"] diff --git a/README.md b/README.md index 78d79f7f..34b5e217 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: diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 00000000..4ff35c73 --- /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