Skip to content

Commit b423406

Browse files
retogmelvincarvalho
authored andcommitted
Added files and instructions to build and run with docker (#607)
Thanks much @retog @rhiaro @nicola merged! I think we can also do a little update to this in January when letsencrypt release wildcard certs.
1 parent 08bea82 commit b423406

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM node:6.11.1-onbuild
2+
EXPOSE 8443
3+
RUN cp config.json-default config.json
4+
RUN openssl req \
5+
-new \
6+
-newkey rsa:4096 \
7+
-days 365 \
8+
-nodes \
9+
-x509 \
10+
-subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" \
11+
-keyout cert.key \
12+
-out cert.pem
13+
CMD npm run solid start

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323

2424
### Install
2525

26+
You can install and run the server either using Node.js directly or using
27+
[Docker](https://www.docker.com/). This and the following sections describe the
28+
first approach, for the second approach see the section [use Docker](#use-docker)
29+
Section below.
30+
2631
To install, first install [Node](https://nodejs.org/en/) and then run the following
2732

2833
```bash
@@ -189,6 +194,27 @@ $ solid start --help
189194
-v, --verbose Print the logs to console
190195
```
191196

197+
## Use Docker
198+
199+
Build with:
200+
201+
```bash
202+
docker build -t node-solid-server .
203+
```
204+
205+
Run with:
206+
```bash
207+
docker run -p 8443:8443 --name solid node-solid-server
208+
```
209+
210+
Modify the config as follows:
211+
212+
- Copy the config to the current directory with: `docker cp solid:/usr/src/app/config.json .`
213+
- Edit the `config.json` file
214+
- Copy the file back with `docker cp config.json solid:/usr/src/app/`
215+
- Restart the server with `docker restart solid`
216+
217+
192218
## Library Usage
193219

194220
### Install Dependencies

config.json-default

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"root": "./data",
3+
"port": "8443",
4+
"serverUri": "https://localhost:8443",
5+
"webid": true,
6+
"mount": "/",
7+
"configPath": "./config",
8+
"dbPath": "./.db",
9+
"sslKey": "./cert.key",
10+
"sslCert": "./cert.pem",
11+
"multiuser": true,
12+
"corsProxy": "/proxy"
13+
}

0 commit comments

Comments
 (0)