Skip to content

Commit

Permalink
consistent documentation and configuration in compose file
Browse files Browse the repository at this point in the history
  • Loading branch information
rigelk committed Nov 11, 2020
1 parent b8f3e6b commit a30995f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion support/doc/docker-traefik.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ More at: https://docs.traefik.io/v1.7
#### Run with traefik

```shell
docker-compose -f {docker-compose.yml,docker-compose.traefik.yml} up -d
docker-compose -f docker-compose.yml docker-compose.traefik.yml up -d
```
12 changes: 7 additions & 5 deletions support/doc/docker.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Docker guide

This guide requires [docker](https://www.docker.com/community-edition) and
[docker-compose](https://docs.docker.com/compose/install/) installed.
[docker-compose](https://docs.docker.com/compose/install/).

## Production

Expand All @@ -10,7 +10,9 @@ This guide requires [docker](https://www.docker.com/community-edition) and
**PeerTube does not support webserver host change**. Keep in mind your domain
name is definitive after your first PeerTube start.

#### Go to your peertube workdir
#### 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`.

```shell
cd /your/peertube/directory
Expand Down Expand Up @@ -38,7 +40,7 @@ View the source of the file you're about to download: [.env](https://github.com/
$EDITOR ./docker-compose.yml
```

#### Then tweak the `.env` file to change the environment variables
#### Then tweak the `.env` file to change the environment variables settings

```shell
$EDITOR ./.env
Expand Down Expand Up @@ -72,7 +74,7 @@ docker-compose up
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.

```bash
user@s:~/peertube|master⚡ ⇒ 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
Expand All @@ -85,7 +87,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
user@s:~/peertube|master⚡ ⇒ 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"
Expand Down
11 changes: 6 additions & 5 deletions support/docker/production/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ services:
# nginx configuration file. It runs the default nginx configuration without HTTPS nor SSL,
# so use it in production in tandem with an SSL-terminating reverse-proxy.
webserver:
image: chocobozzz/peertube:webserver
build:
context: .
dockerfile: Dockerfile.nginx
Expand All @@ -16,9 +17,9 @@ services:
# - "9000:80" # serving HTTP
volumes:
- type: bind
# Switch sources if you downloaded the nginx configuration without the whole repository
#source: ./peertube
source: ../../nginx/peertube
# Switch sources if you downloaded the whole repository
#source: ../../nginx/peertube
source: ./docker-volume/nginx/peertube
target: /etc/nginx/conf.d/peertube.template
- assets:/var/www/peertube/peertube-latest/client/dist:ro
- ./docker-volume/data:/var/www/peertube/storage
Expand Down Expand Up @@ -48,15 +49,15 @@ services:
restart: "always"

postgres:
image: postgres:10-alpine
image: postgres:13-alpine
env_file:
- .env
volumes:
- ./docker-volume/db:/var/lib/postgresql/data
restart: "always"

redis:
image: redis:5-alpine
image: redis:6-alpine
volumes:
- ./docker-volume/redis:/data
restart: "always"
Expand Down
2 changes: 1 addition & 1 deletion support/docker/production/entrypoint.nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export PEERTUBE_HOST="peertube:9000"

envsubst '${WEBSERVER_HOST} ${PEERTUBE_HOST}' < $SOURCE_FILE > $TARGET_FILE

# Remove HTTPS/SSL from nginx conf
# Remove HTTPS/SSL from nginx conf since this image is meant as a webserver _behind_ a reverse-proxy doing TLS termination itself
sed -i 's/443 ssl http2/80/g;/ssl_/d' $TARGET_FILE

nginx -g "daemon off;"

0 comments on commit a30995f

Please sign in to comment.