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 Dockerfiles and Docker instructions #26

Open
wants to merge 1 commit into
base: main
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
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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
```
8 changes: 8 additions & 0 deletions mashlib/Dockerfile
Original file line number Diff line number Diff line change
@@ -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/
8 changes: 8 additions & 0 deletions penny/Dockerfile
Original file line number Diff line number Diff line change
@@ -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/