]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - support/doc/docker.md
Update translations
[github/Chocobozzz/PeerTube.git] / support / doc / docker.md
index 97eecc3adfc0620717080ace6f2346d6b2fa019b..78a8d2d32a0ed51650293917ae020d3c41a25729 100644 (file)
@@ -1,7 +1,11 @@
 # Docker guide
 
 This guide requires [docker](https://www.docker.com/community-edition) and
-[docker-compose](https://docs.docker.com/compose/install/).
+[docker-compose V2](https://docs.docker.com/compose/install/).
+
+```shell
+docker compose version # Must be > 2.x.x
+```
 
 ## Install
 
@@ -10,7 +14,9 @@ name is definitive after your first PeerTube start.
 
 #### Go to your workdir
 
-_note_: the guide that follows assumes an empty workdir, but you can also clone the repository, use the master branch and `cd support/docker/production`.
+:::info
+The guide that follows assumes an empty workdir, but you can also clone the repository, use the master branch and `cd support/docker/production`.
+:::
 
 ```shell
 cd /your/peertube/directory
@@ -35,13 +41,13 @@ View the source of the file you're about to download: [.env](https://github.com/
 #### Tweak the `docker-compose.yml` file there according to your needs
 
 ```shell
-$EDITOR ./docker-compose.yml
+sudo nano docker-compose.yml
 ```
 
 #### Then tweak the `.env` file to change the environment variables settings
 
 ```shell
-$EDITOR ./.env
+sudo nano .env
 ```
 
 In the downloaded example [.env](https://github.com/Chocobozzz/PeerTube/blob/master/support/docker/production/.env), you must replace:
@@ -49,6 +55,7 @@ In the downloaded example [.env](https://github.com/Chocobozzz/PeerTube/blob/mas
 - `<MY POSTGRES PASSWORD>`
 - `<MY DOMAIN>` without 'https://'
 - `<MY EMAIL ADDRESS>`
+- `<MY PEERTUBE SECRET>`
 
 Other environment variables are used in
 [/support/docker/production/config/custom-environment-variables.yaml](https://github.com/Chocobozzz/PeerTube/blob/master/support/docker/production/config/custom-environment-variables.yaml) and can be
@@ -56,7 +63,8 @@ intuited from usage.
 
 #### Webserver
 
-*The docker compose file includes a configured web server. You can skip this part and comment the appropriate section in the docker compose if you use another webserver/proxy.*
+::: info
+The docker compose file includes a configured web server. You can skip this part and comment the appropriate section in the docker compose if you use another webserver/proxy.:::
 
 Install the template that the nginx container will use.
 The container will generate the configuration by replacing `${WEBSERVER_HOST}` and `${PEERTUBE_HOST}` using your docker compose env file.
@@ -78,6 +86,8 @@ A dedicated container in the docker-compose will automatically renew this certif
 
 #### Test your setup
 
+_note_: Newer versions of compose are called with `docker compose` instead of `docker-compose`, so remove the dash in all steps that use this command if you are getting errors.
+
 Run your containers:
 
 ```shell
@@ -86,10 +96,15 @@ docker-compose up
 
 #### Obtaining your automatically-generated admin credentials
 
-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.
+You can change the automatically created password for user root by running this command from peertube's root directory:
+```shell
+docker-compose exec -u peertube peertube npm run reset-password -- -u root
+```
+
+You can also grep your peertube container's logs for the default `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.
 
 ```bash
-docker-compose logs peertube | grep -A1 root
+docker-compose logs peertube | grep -A1 root
 
 peertube_1  | [example.com:443] 2019-11-16 04:26:06.082 info: Username: root
 peertube_1  | [example.com:443] 2019-11-16 04:26:06.083 info: User password: abcdefghijklmnop
@@ -102,7 +117,7 @@ peertube_1  | [example.com:443] 2019-11-16 04:26:06.083 info: User password: abc
 Run `cat ./docker-volume/opendkim/keys/*/*.txt` to display your DKIM DNS TXT Record containing the public key to configure to your domain :
 
 ```bash
-cat ./docker-volume/opendkim/keys/*/*.txt
+cat ./docker-volume/opendkim/keys/*/*.txt
 
 peertube._domainkey.mydomain.tld.      IN      TXT     ( "v=DKIM1; h=sha256; k=rsa; "
          "p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0Dx7wLGPFVaxVQ4TGym/eF89aQ8oMxS9v5BCc26Hij91t2Ci8Fl12DHNVqZoIPGm+9tTIoDVDFEFrlPhMOZl8i4jU9pcFjjaIISaV2+qTa8uV1j3MyByogG8pu4o5Ill7zaySYFsYB++cHJ9pjbFSC42dddCYMfuVgrBsLNrvEi3dLDMjJF5l92Uu8YeswFe26PuHX3Avr261n"
@@ -111,33 +126,35 @@ peertube._domainkey.mydomain.tld. IN      TXT     ( "v=DKIM1; h=sha256; k=rsa; "
 
 #### Administrator password
 
-See the production guide ["Administrator" section](https://docs.joinpeertube.org/install-any-os?id=technologist-administrator)
+See the production guide ["Administrator" section](https://docs.joinpeertube.org/install/any-os#administrator)
 
 #### What now?
 
-See the production guide ["What now" section](https://docs.joinpeertube.org/install-any-os?id=tada-what-now).
+See the production guide ["What now" section](https://docs.joinpeertube.org/install/any-os#what-now).
 
 ## Upgrade
 
-**Important:** Before upgrading, check you have all the `storage` fields in your [production.yaml file](https://github.com/Chocobozzz/PeerTube/blob/master/support/docker/production/config/production.yaml).
+::: warning
+Check the changelog (in particular the *IMPORTANT NOTES* section):** https://github.com/Chocobozzz/PeerTube/blob/develop/CHANGELOG.md
+:::
 
 Pull the latest images:
 
 ```shell
-cd /your/peertube/directory
-docker-compose pull
+cd /your/peertube/directory
+docker-compose pull
 ```
 
 Stop, delete the containers and internal volumes (to invalidate static client files shared by `peertube` and `webserver` containers):
 
 ```shell
-docker-compose down -v
+docker-compose down -v
 ```
 
 Rerun PeerTube:
 
 ```shell
-docker-compose up -d
+docker-compose up -d
 ```
 
 ## Build
@@ -145,9 +162,9 @@ $ docker-compose up -d
 ### Production
 
 ```shell
-git clone https://github.com/chocobozzz/PeerTube /tmp/peertube
-cd /tmp/peertube
-docker build . -f ./support/docker/production/Dockerfile.bullseye
+git clone https://github.com/chocobozzz/PeerTube /tmp/peertube
+cd /tmp/peertube
+docker build . -f ./support/docker/production/Dockerfile.bullseye
 ```
 
 ### Development