Skip to content

Commit d1509dd

Browse files
authored
Merge pull request #1482 from solid/docker-examples
add all-in-one example docker-compose
2 parents 6d308aa + fce884a commit d1509dd

File tree

3 files changed

+84
-0
lines changed

3 files changed

+84
-0
lines changed

docker-image/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ When using nginx to proxy HTTPS connections to Solid you will need to specify HT
4242
This approach is useful if you do not wish to grant Solid access to your HTTPS certificates, as nginx does not validate
4343
the self-signed certificates that Solid generates for its proxy_pass connection.
4444

45+
#### All-in one nginx proxy + letsencrypt + solid server
46+
47+
`./examples/docker-compose.all-in-one.yml`
48+
49+
Run solid-server on port 8443 behind a [nginx proxy](https://hub.docker.com/r/jwilder/nginx-proxy/) on 443, including
50+
certificate generation via [letsencrypt companion](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion).
51+
4552
#### Other setups
4653

4754
The setup you need is not presented here? Feel free to ask, or provide a Pull Request
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# This example assumes, that you are not running another application or proxy on ports 80 / 443.
2+
# It provides an all-in-one solution to start a docker-server together with an nginx proxy and
3+
# automatic letsencrypt certificate generation and renewal.
4+
#
5+
# It is based on https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion/blob/master/docs/Docker-Compose.md
6+
#
7+
# Adjust any line that is commented with (!):
8+
# 1. Change any occurrence of the domain `solid.example` to your actual domain
9+
# 2. Adjust the `latest` tag to a specific version you want to use.
10+
11+
version: '3.7'
12+
services:
13+
nginx:
14+
container_name: nginx
15+
image: jwilder/nginx-proxy:latest
16+
restart: always
17+
ports:
18+
- "80:80"
19+
- "443:443"
20+
volumes:
21+
- nginx-conf:/etc/nginx/conf.d
22+
- vhostd:/etc/nginx/vhost.d
23+
- html:/usr/share/nginx/html
24+
- /var/run/docker.sock:/tmp/docker.sock:ro
25+
- certs:/etc/nginx/certs:ro
26+
27+
letsencrypt:
28+
container_name: letsencrypt
29+
image: jrcs/letsencrypt-nginx-proxy-companion:latest
30+
restart: always
31+
environment:
32+
- "NGINX_PROXY_CONTAINER=nginx"
33+
volumes:
34+
- nginx-conf:/etc/nginx/conf.d
35+
- vhostd:/etc/nginx/vhost.d
36+
- html:/usr/share/nginx/html
37+
- /var/run/docker.sock:/var/run/docker.sock:ro
38+
- certs:/etc/nginx/certs
39+
40+
server:
41+
image: nodesolidserver/node-solid-server:latest # (!) use specific version tag here
42+
43+
# this ensures automatic container start, when host reboots
44+
restart: always
45+
46+
expose:
47+
- 8443
48+
49+
volumes:
50+
# mount local directories to the container
51+
# (!) the host directories have to exist and be owned by UID 1000
52+
- /opt/solid/data:/opt/solid/data
53+
- /opt/solid/.db:/opt/solid/.db
54+
- /opt/solid/config:/opt/solid/config
55+
- certs:/opt/solid/certs
56+
57+
environment:
58+
# (!) use your actual SOLID_SERVER_URI
59+
- "SOLID_SERVER_URI=https://solid.example"
60+
# (!) adjust path to the letsencrypt key and cert
61+
- "SOLID_SSL_KEY=/opt/solid/certs/solid.example/key.pem"
62+
- "SOLID_SSL_CERT=/opt/solid/certs/solid.example/fullchain.pem"
63+
# (!) use your actual host name
64+
- "VIRTUAL_HOST=solid.example"
65+
- "VIRTUAL_PORT=8443"
66+
- "VIRTUAL_PROTO=https"
67+
# (!) use your actual host name
68+
- "LETSENCRYPT_HOST=solid.example"
69+
# (!) use your actual email
70+
- "LETSENCRYPT_EMAIL=your@mail.example"
71+
72+
volumes:
73+
nginx-conf:
74+
vhostd:
75+
html:
76+
certs:

docker-image/examples/docker-compose.nginx.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ services:
4343
- "VIRTUAL_PROTO=https"
4444
# (!) use your actual host name
4545
- "LETSENCRYPT_HOST=solid.example"
46+
# (!) use your actual email
4647
- "LETSENCRYPT_EMAIL=your@mail.example"
4748
volumes:
4849
# (!) mount certificates from an external volume from your nginx setup

0 commit comments

Comments
 (0)