Skip to content

Commit 95d674f

Browse files
committed
add all-in-one example
1 parent 6454d77 commit 95d674f

3 files changed

Lines changed: 86 additions & 1 deletion

File tree

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,15 @@ You will need to have your certificates ready and mount them into the container.
3333

3434
`./examples/docker-compose.nginx.yml`
3535

36-
Run solid-server on port 8443 behind a nginx proxy on 443. You will need to setup an nginx container with letsencrypt companion [as described here](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion).
36+
Run solid-server on port 8443 behind a nginx proxy on 443. You will need to setup an nginx container with letsencrypt
37+
companion [as described here](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion).
38+
39+
#### All-in one nginx proxy + letsencrypt + solid server
40+
41+
`./examples/docker-compose.all-in-one.yml`
42+
43+
Run solid-server on port 8443 behind a [nginx proxy](https://hub.docker.com/r/jwilder/nginx-proxy/) on 443, including
44+
certificate generation via [letsencrypt companion](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion).
3745

3846
#### Other setups
3947

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: aveltens/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:

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)