diff --git a/support/doc/docker.md b/support/doc/docker.md index 7f3311827..1485e7e85 100644 --- a/support/doc/docker.md +++ b/support/doc/docker.md @@ -12,37 +12,42 @@ PeerTube needs a PostgreSQL and a Redis instance to work correctly. If you want to quickly set up a full environment, either for trying the service or in production, you can use a `docker-compose` setup. -```bash +```shell $ cd /your/peertube/directory $ mkdir ./docker-volume && mkdir ./docker-volume/traefik $ curl "https://raw.githubusercontent.com/chocobozzz/PeerTube/master/support/docker/production/config/traefik.toml" > ./docker-volume/traefik/traefik.toml $ touch ./docker-volume/traefik/acme.json && chmod 600 ./docker-volume/traefik/acme.json -$ curl -s "https://raw.githubusercontent.com/chocobozzz/PeerTube/master/support/docker/production/docker-compose.yml" > ./docker-compose.yml +$ curl -s "https://raw.githubusercontent.com/chocobozzz/PeerTube/master/support/docker/production/docker-compose.yml" -o docker-compose.yml "https://raw.githubusercontent.com/Chocobozzz/PeerTube/master/support/docker/production/.env" -o .env ``` Update the reverse proxy configuration: -``` +```shell $ vim ./docker-volume/traefik/traefik.toml ``` Tweak the `docker-compose.yml` file there according to your needs: -``` +```shell $ vim ./docker-compose.yaml ``` -You can use the regular `up` command to set it up, with possible overrides of -the environment variables: +Then tweak the `.env` file to change the enviromnent variables: -```bash -$ PEERTUBE_WEBSERVER_HOSTNAME="domain.tld" docker-compose up +```shell +$ vim ./.env ``` Other environment variables are used in `support/docker/production/config/custom-environment-variables.yaml` and can be intuited from usage. +You can use the regular `up` command to set it up: + +```shell +$ docker-compose up +``` + **Important**: note that you'll get the initial `root` user password from the program output, so check out your logs to find them. @@ -50,17 +55,17 @@ program output, so check out your logs to find them. Pull the latest images and rerun PeerTube: -``` +```shell $ cd /your/peertube/directory $ docker-compose down $ docker-compose pull -$ PEERTUBE_WEBSERVER_HOSTNAME="domain.tld" docker-compose up -d +$ docker-compose up -d ``` ## Build your own Docker image -```bash +```shell $ git clone https://github.com/chocobozzz/PeerTube /tmp/peertube $ cd /tmp/peertube $ docker build . -f ./support/docker/production/Dockerfile.stretch @@ -69,4 +74,4 @@ $ docker build . -f ./support/docker/production/Dockerfile.stretch ## Development We don't have a Docker image for development. See [the CONTRIBUTING guide](https://github.com/Chocobozzz/PeerTube/blob/develop/.github/CONTRIBUTING.md#develop) -for more information on how you can hack PeerTube! \ No newline at end of file +for more information on how you can hack PeerTube! diff --git a/support/docker/production/.env b/support/docker/production/.env new file mode 100644 index 000000000..06cc90b54 --- /dev/null +++ b/support/docker/production/.env @@ -0,0 +1,15 @@ +DB_USERNAME=postgres_user +DB_PASSWORD=postgres_password +PEERTUBE_WEBSERVER_HOSTNAME=my.domain.tld +PEERTUBE_WEBSERVER_PORT=443 +PEERTUBE_WEBSERVER_HTTPS="true" +PEERTUBE_REDIS_HOSTNAME=redis +PEERTUBE_SMTP_USERNAME=null +PEERTUBE_SMTP_PASSWORD=null +PEERTUBE_SMTP_HOSTNAME=null +PEERTUBE_SMTP_PORT=25 +PEERTUBE_SMTP_FROM=noreply@peertube.domain.tld +PEERTUBE_SMTP_TLS="true" +PEERTUBE_ADMIN_EMAIL=admin@domain.tld +PEERTUBE_SIGNUP_ENABLED="true" +PEERTUBE_TRANSCODING_ENABLED="true" diff --git a/support/docker/production/docker-compose.yml b/support/docker/production/docker-compose.yml index 8144502e7..a4a829b40 100644 --- a/support/docker/production/docker-compose.yml +++ b/support/docker/production/docker-compose.yml @@ -22,23 +22,23 @@ services: # dockerfile: ./support/docker/production/Dockerfile.stretch image: chocobozzz/peertube:production-stretch environment: - PEERTUBE_WEBSERVER_HOSTNAME: my.domain.tld - PEERTUBE_WEBSERVER_PORT: 443 - PEERTUBE_WEBSERVER_HTTPS: "true" + PEERTUBE_WEBSERVER_HOSTNAME: ${PEERTUBE_WEBSERVER_HOSTNAME} + PEERTUBE_WEBSERVER_PORT: ${PEERTUBE_WEBSERVER_PORT} + PEERTUBE_WEBSERVER_HTTPS: ${PEERTUBE_WEBSERVER_HTTPS} PEERTUBE_DB_HOSTNAME: postgres - PEERTUBE_DB_USERNAME: postgres_user - PEERTUBE_DB_PASSWORD: postgres_password + PEERTUBE_DB_USERNAME: ${DB_USERNAME} + PEERTUBE_DB_PASSWORD: ${DB_PASSWORD} PEERTUBE_REDIS_HOSTNAME: redis - PEERTUBE_SMTP_USERNAME: null - PEERTUBE_SMTP_PASSWORD: null - PEERTUBE_SMTP_HOSTNAME: null - PEERTUBE_SMTP_PORT: 25 - PEERTUBE_SMTP_FROM: noreply@peertube.domain.tld - PEERTUBE_SMTP_TLS: "true" + PEERTUBE_SMTP_USERNAME: ${PEERTUBE_SMTP_USERNAME} + PEERTUBE_SMTP_PASSWORD: ${PEERTUBE_SMTP_PASSWORD} + PEERTUBE_SMTP_HOSTNAME: ${PEERTUBE_SMTP_HOSTNAME} + PEERTUBE_SMTP_PORT: ${PEERTUBE_SMTP_PORT} + PEERTUBE_SMTP_FROM: ${PEERTUBE_SMTP_FROM} + PEERTUBE_SMTP_TLS: ${PEERTUBE_SMTP_TLS} # /!\ Prefer to use the PeerTube admin interface to set the following configurations /!\ - # PEERTUBE_ADMIN_EMAIL: admin@domain.tld - # PEERTUBE_SIGNUP_ENABLED: "true" - # PEERTUBE_TRANSCODING_ENABLED: "true" + # PEERTUBE_ADMIN_EMAIL: ${PEERTUBE_ADMIN_EMAIL} + # PEERTUBE_SIGNUP_ENABLED: ${PEERTUBE_SIGNUP_ENABLED} + # PEERTUBE_TRANSCODING_ENABLED: ${PEERTUBE_TRANSCODING_ENABLED} # Traefik labels are suggested as an example for people using Traefik, # remove them if you are using another reverse proxy. labels: @@ -59,8 +59,8 @@ services: postgres: image: postgres:10-alpine environment: - POSTGRES_USER: postgres_user - POSTGRES_PASSWORD: postgres_password + POSTGRES_USER: ${DB_USERNAME} + POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_DB: peertube volumes: - ./docker-volume/db:/var/lib/postgresql/data @@ -74,4 +74,4 @@ services: - ./docker-volume/redis:/data restart: "always" labels: - traefik.enable: "false" \ No newline at end of file + traefik.enable: "false"