diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-06-22 13:06:54 +0200 |
---|---|---|
committer | Rigel Kent <sendmemail@rigelk.eu> | 2020-11-11 16:45:46 +0100 |
commit | b8f3e6b00b3300f4ebf37bf77711739964c9e5d6 (patch) | |
tree | 00500e5e4c1cebae277972e6ff8e1373298504cd /support/doc/docker.md | |
parent | e604efcb71ca3bbff701598969d055d688161985 (diff) | |
download | PeerTube-b8f3e6b00b3300f4ebf37bf77711739964c9e5d6.tar.gz PeerTube-b8f3e6b00b3300f4ebf37bf77711739964c9e5d6.tar.zst PeerTube-b8f3e6b00b3300f4ebf37bf77711739964c9e5d6.zip |
move traefik to its own override file
Diffstat (limited to 'support/doc/docker.md')
-rw-r--r-- | support/doc/docker.md | 71 |
1 files changed, 19 insertions, 52 deletions
diff --git a/support/doc/docker.md b/support/doc/docker.md index fc89e4c4c..e55aee9fc 100644 --- a/support/doc/docker.md +++ b/support/doc/docker.md | |||
@@ -1,46 +1,19 @@ | |||
1 | # Docker guide | 1 | # Docker guide |
2 | 2 | ||
3 | You can quickly get a server running using Docker. You need to have | 3 | This guide requires [docker](https://www.docker.com/community-edition) and |
4 | [docker](https://www.docker.com/community-edition) and | ||
5 | [docker-compose](https://docs.docker.com/compose/install/) installed. | 4 | [docker-compose](https://docs.docker.com/compose/install/) installed. |
6 | 5 | ||
7 | ## Production | 6 | ## Production |
8 | 7 | ||
9 | ### Install | 8 | ### Install |
10 | 9 | ||
11 | **PeerTube does not support webserver host change**. Keep in mind your domain name is definitive after your first PeerTube start. | 10 | **PeerTube does not support webserver host change**. Keep in mind your domain |
12 | 11 | name is definitive after your first PeerTube start. | |
13 | PeerTube needs a PostgreSQL and a Redis instance to work correctly. If you want | ||
14 | to quickly set up a full environment, either for trying the service or in | ||
15 | production, you can use a `docker-compose` setup. | ||
16 | 12 | ||
17 | #### Go to your peertube workdir | 13 | #### Go to your peertube workdir |
18 | ```shell | ||
19 | cd /your/peertube/directory | ||
20 | ``` | ||
21 | |||
22 | #### Create the reverse proxy configuration directory | ||
23 | |||
24 | ```shell | ||
25 | mkdir -p ./docker-volume/traefik | ||
26 | ``` | ||
27 | 14 | ||
28 | #### Get the latest reverse proxy configuration | ||
29 | |||
30 | ```shell | ||
31 | curl https://raw.githubusercontent.com/chocobozzz/PeerTube/master/support/docker/production/config/traefik.toml > ./docker-volume/traefik/traefik.toml | ||
32 | ``` | ||
33 | |||
34 | View the source of the file you're about to download: [traefik.toml](https://github.com/Chocobozzz/PeerTube/blob/master/support/docker/production/config/traefik.toml) | ||
35 | |||
36 | #### Create Let's Encrypt ACME certificates as JSON file | ||
37 | |||
38 | ```shell | ||
39 | touch ./docker-volume/traefik/acme.json | ||
40 | ``` | ||
41 | Needs to have file mode 600: | ||
42 | ```shell | 15 | ```shell |
43 | chmod 600 ./docker-volume/traefik/acme.json | 16 | cd /your/peertube/directory |
44 | ``` | 17 | ``` |
45 | 18 | ||
46 | #### Get the latest Compose file | 19 | #### Get the latest Compose file |
@@ -51,7 +24,6 @@ curl https://raw.githubusercontent.com/chocobozzz/PeerTube/master/support/docker | |||
51 | 24 | ||
52 | View the source of the file you're about to download: [docker-compose.yml](https://github.com/Chocobozzz/PeerTube/blob/master/support/docker/production/docker-compose.yml) | 25 | View the source of the file you're about to download: [docker-compose.yml](https://github.com/Chocobozzz/PeerTube/blob/master/support/docker/production/docker-compose.yml) |
53 | 26 | ||
54 | |||
55 | #### Get the latest env_file | 27 | #### Get the latest env_file |
56 | 28 | ||
57 | ```shell | 29 | ```shell |
@@ -60,27 +32,18 @@ curl https://raw.githubusercontent.com/Chocobozzz/PeerTube/master/support/docker | |||
60 | 32 | ||
61 | View the source of the file you're about to download: [.env](https://github.com/Chocobozzz/PeerTube/blob/master/support/docker/production/.env) | 33 | View the source of the file you're about to download: [.env](https://github.com/Chocobozzz/PeerTube/blob/master/support/docker/production/.env) |
62 | 34 | ||
63 | #### Update the reverse proxy configuration | ||
64 | |||
65 | ```shell | ||
66 | vim ./docker-volume/traefik/traefik.toml | ||
67 | ``` | ||
68 | |||
69 | ~~You must replace `<MY EMAIL ADDRESS>` and `<MY DOMAIN>` to enable Let's Encrypt SSL Certificates creation.~~ Now included in `.env` file with `TRAEFIK_ACME_EMAIL` and `TRAEFIK_ACME_DOMAINS` variables used through traefik service command value of `docker-compose.yml` file. | ||
70 | |||
71 | More at: https://docs.traefik.io/v1.7 | ||
72 | |||
73 | #### Tweak the `docker-compose.yml` file there according to your needs | 35 | #### Tweak the `docker-compose.yml` file there according to your needs |
74 | 36 | ||
75 | ```shell | 37 | ```shell |
76 | vim ./docker-compose.yml | 38 | $EDITOR ./docker-compose.yml |
77 | ``` | 39 | ``` |
78 | 40 | ||
79 | #### Then tweak the `.env` file to change the environment variables | 41 | #### Then tweak the `.env` file to change the environment variables |
80 | 42 | ||
81 | ```shell | 43 | ```shell |
82 | vim ./.env | 44 | $EDITOR ./.env |
83 | ``` | 45 | ``` |
46 | |||
84 | In the downloaded example [.env](https://github.com/Chocobozzz/PeerTube/blob/master/support/docker/production/.env), you must replace: | 47 | In the downloaded example [.env](https://github.com/Chocobozzz/PeerTube/blob/master/support/docker/production/.env), you must replace: |
85 | - `<MY POSTGRES USERNAME>` | 48 | - `<MY POSTGRES USERNAME>` |
86 | - `<MY POSTGRES PASSWORD>` | 49 | - `<MY POSTGRES PASSWORD>` |
@@ -103,10 +66,12 @@ To test locally your Docker setup, you must add your domain (`<MY DOMAIN>`) in ` | |||
103 | ```shell | 66 | ```shell |
104 | docker-compose up | 67 | docker-compose up |
105 | ``` | 68 | ``` |
106 | ### Obtaining Your Automatically Generated Admin Credentials | 69 | |
107 | Now that you've installed your PeerTube instance you'll want to grep your peertube container's logs for the `root` password. | 70 | ### Obtaining your automatically-generated admin credentials |
108 | You're going to want to run `docker-compose logs peertube | grep -A1 root` to search the log output for your new PeerTube's instance admin credentials which will look something like this. | 71 | |
109 | ```BASH | 72 | Now that you've installed your PeerTube instance you'll want to grep your peertube container's logs for the `root` password. You're going to want to run `docker-compose logs peertube | grep -A1 root` to search the log output for your new PeerTube's instance admin credentials which will look something like this. |
73 | |||
74 | ```bash | ||
110 | user@s:~/peertube|master⚡ ⇒ docker-compose logs peertube | grep -A1 root | 75 | user@s:~/peertube|master⚡ ⇒ docker-compose logs peertube | grep -A1 root |
111 | 76 | ||
112 | peertube_1 | [example.com:443] 2019-11-16 04:26:06.082 info: Username: root | 77 | peertube_1 | [example.com:443] 2019-11-16 04:26:06.082 info: Username: root |
@@ -114,9 +79,12 @@ peertube_1 | [example.com:443] 2019-11-16 04:26:06.083 info: User password: abc | |||
114 | ``` | 79 | ``` |
115 | 80 | ||
116 | ### Obtaining Your Automatically Generated DKIM DNS TXT Record | 81 | ### Obtaining Your Automatically Generated DKIM DNS TXT Record |
82 | |||
117 | [DKIM](https://en.wikipedia.org/wiki/DomainKeys_Identified_Mail) signature sending and RSA keys generation are enabled by the default Postfix image `mwader/postfix-relay` with [OpenDKIM](http://www.opendkim.org/). | 83 | [DKIM](https://en.wikipedia.org/wiki/DomainKeys_Identified_Mail) signature sending and RSA keys generation are enabled by the default Postfix image `mwader/postfix-relay` with [OpenDKIM](http://www.opendkim.org/). |
118 | Run `cat ./docker-volume/opendkim/keys/*/*.txt` to display your DKIM DNS TXT Record containing the public key to configure to your domain : | 84 | |
119 | ```BASH | 85 | Run `cat ./docker-volume/opendkim/keys/*/*.txt` to display your DKIM DNS TXT Record containing the public key to configure to your domain : |
86 | |||
87 | ```bash | ||
120 | user@s:~/peertube|master⚡ ⇒ cat ./docker-volume/opendkim/keys/*/*.txt | 88 | user@s:~/peertube|master⚡ ⇒ cat ./docker-volume/opendkim/keys/*/*.txt |
121 | 89 | ||
122 | peertube._domainkey.mydomain.tld. IN TXT ( "v=DKIM1; h=sha256; k=rsa; " | 90 | peertube._domainkey.mydomain.tld. IN TXT ( "v=DKIM1; h=sha256; k=rsa; " |
@@ -154,5 +122,4 @@ $ docker build . -f ./support/docker/production/Dockerfile.buster | |||
154 | 122 | ||
155 | ## Development | 123 | ## Development |
156 | 124 | ||
157 | We don't have a Docker image for development. See [the CONTRIBUTING guide](https://github.com/Chocobozzz/PeerTube/blob/master/.github/CONTRIBUTING.md#develop) | 125 | We don't have a Docker image for development. See [the CONTRIBUTING guide](https://github.com/Chocobozzz/PeerTube/blob/master/.github/CONTRIBUTING.md#develop) for more information on how you can hack PeerTube! |
158 | for more information on how you can hack PeerTube! | ||