From ee9b4a1800b056076832e893c1140ac3f039642f Mon Sep 17 00:00:00 2001 From: Vidminas Mikucionis <5411598+Vidminas@users.noreply.github.com> Date: Tue, 25 Oct 2022 21:34:32 +0100 Subject: [PATCH] Add Dockerfiles and Docker instructions --- README.md | 19 +++++++++++++++++-- mashlib/Dockerfile | 8 ++++++++ penny/Dockerfile | 8 ++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 mashlib/Dockerfile create mode 100644 penny/Dockerfile diff --git a/README.md b/README.md index 5776a57..e775285 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,8 @@ You can launch the Community Solid Server with the following user interfaces: - [Penny](https://forum.solidproject.org/t/new-developer-tool-app-penny/3837) -## ⚙️ Installing the recipes +## ⚙️ Installing the recipes using Node + ```shell # Load the configurations to your device git clone https://github.com/CommunitySolidServer/Recipes @@ -22,7 +23,7 @@ npm ci --production ``` -## 🚀 Starting the server from a recipe +## 🚀 Starting the server from a recipe using Node ### Mashlib The Mashlib configurations are in the `mashlib` folder. @@ -42,3 +43,17 @@ The Penny configurations are in the `penny` folder. # Start the server with your documents folder as the root container npx community-solid-server -c config-penny.json -f ~/Documents/ ``` + + +## 🐋 Installing/running using Docker + +With Docker, you can combine the steps of installing the recipes and starting the server into one. + +```shell +git clone https://github.com/CommunitySolidServer/Recipes +cd Recipes/ +docker build -f mashlib/Dockerfile -t css-recipes:mashlib . +# docker build -f penny/Dockerfile -t css-recipes:penny . +docker run --rm -v ~/Documents/:/data/ -p 3000:3000 -it css-recipes:mashlib -c config/config-mashlib.json +# docker run --rm -v ~/Documents/:/data/ -p 3000:300 -it css-recipes:penny -c config/config-penny.json +``` \ No newline at end of file diff --git a/mashlib/Dockerfile b/mashlib/Dockerfile new file mode 100644 index 0000000..c109743 --- /dev/null +++ b/mashlib/Dockerfile @@ -0,0 +1,8 @@ +FROM node:lts-alpine AS build +WORKDIR /usr/src/app/ +COPY /mashlib/ ./ +RUN npm clean-install --omit=dev + +FROM solidproject/community-server AS production +COPY --from=build /usr/src/app/node_modules/ /community-server/node_modules/ +COPY /mashlib/config* /community-server/config/ \ No newline at end of file diff --git a/penny/Dockerfile b/penny/Dockerfile new file mode 100644 index 0000000..97e2d37 --- /dev/null +++ b/penny/Dockerfile @@ -0,0 +1,8 @@ +FROM node:lts-alpine AS build +WORKDIR /usr/src/app/ +COPY /penny/ ./ +RUN npm clean-install --omit=dev + +FROM solidproject/community-server AS production +COPY --from=build /usr/src/app/node_modules/ /community-server/node_modules/ +COPY /penny/config* /community-server/config/ \ No newline at end of file