|
| 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: |
0 commit comments