diff options
author | Florent Poinsaut <florent@poinsaut.fr> | 2018-06-02 08:36:49 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-05 08:47:01 +0200 |
commit | f83e339b82b00faeb61ee8bebf720fbaebc367a6 (patch) | |
tree | 14b258c34dc2aa8bf5774a30938084ed8134d492 | |
parent | f8b447538643759217bb25559ac334378ce5ca82 (diff) | |
download | PeerTube-f83e339b82b00faeb61ee8bebf720fbaebc367a6.tar.gz PeerTube-f83e339b82b00faeb61ee8bebf720fbaebc367a6.tar.zst PeerTube-f83e339b82b00faeb61ee8bebf720fbaebc367a6.zip |
Environment variables for Docker Compose
-rw-r--r-- | support/doc/docker.md | 29 | ||||
-rw-r--r-- | support/docker/production/.env | 15 | ||||
-rw-r--r-- | support/docker/production/docker-compose.yml | 34 |
3 files changed, 49 insertions, 29 deletions
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 | |||
12 | to quickly set up a full environment, either for trying the service or in | 12 | to quickly set up a full environment, either for trying the service or in |
13 | production, you can use a `docker-compose` setup. | 13 | production, you can use a `docker-compose` setup. |
14 | 14 | ||
15 | ```bash | 15 | ```shell |
16 | $ cd /your/peertube/directory | 16 | $ cd /your/peertube/directory |
17 | $ mkdir ./docker-volume && mkdir ./docker-volume/traefik | 17 | $ mkdir ./docker-volume && mkdir ./docker-volume/traefik |
18 | $ curl "https://raw.githubusercontent.com/chocobozzz/PeerTube/master/support/docker/production/config/traefik.toml" > ./docker-volume/traefik/traefik.toml | 18 | $ curl "https://raw.githubusercontent.com/chocobozzz/PeerTube/master/support/docker/production/config/traefik.toml" > ./docker-volume/traefik/traefik.toml |
19 | $ touch ./docker-volume/traefik/acme.json && chmod 600 ./docker-volume/traefik/acme.json | 19 | $ touch ./docker-volume/traefik/acme.json && chmod 600 ./docker-volume/traefik/acme.json |
20 | $ curl -s "https://raw.githubusercontent.com/chocobozzz/PeerTube/master/support/docker/production/docker-compose.yml" > ./docker-compose.yml | 20 | $ 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 |
21 | ``` | 21 | ``` |
22 | 22 | ||
23 | Update the reverse proxy configuration: | 23 | Update the reverse proxy configuration: |
24 | 24 | ||
25 | ``` | 25 | ```shell |
26 | $ vim ./docker-volume/traefik/traefik.toml | 26 | $ vim ./docker-volume/traefik/traefik.toml |
27 | ``` | 27 | ``` |
28 | 28 | ||
29 | Tweak the `docker-compose.yml` file there according to your needs: | 29 | Tweak the `docker-compose.yml` file there according to your needs: |
30 | 30 | ||
31 | ``` | 31 | ```shell |
32 | $ vim ./docker-compose.yaml | 32 | $ vim ./docker-compose.yaml |
33 | ``` | 33 | ``` |
34 | 34 | ||
35 | You can use the regular `up` command to set it up, with possible overrides of | 35 | Then tweak the `.env` file to change the enviromnent variables: |
36 | the environment variables: | ||
37 | 36 | ||
38 | ```bash | 37 | ```shell |
39 | $ PEERTUBE_WEBSERVER_HOSTNAME="domain.tld" docker-compose up | 38 | $ vim ./.env |
40 | ``` | 39 | ``` |
41 | 40 | ||
42 | Other environment variables are used in | 41 | Other environment variables are used in |
43 | `support/docker/production/config/custom-environment-variables.yaml` and can be | 42 | `support/docker/production/config/custom-environment-variables.yaml` and can be |
44 | intuited from usage. | 43 | intuited from usage. |
45 | 44 | ||
45 | You can use the regular `up` command to set it up: | ||
46 | |||
47 | ```shell | ||
48 | $ docker-compose up | ||
49 | ``` | ||
50 | |||
46 | **Important**: note that you'll get the initial `root` user password from the | 51 | **Important**: note that you'll get the initial `root` user password from the |
47 | program output, so check out your logs to find them. | 52 | program output, so check out your logs to find them. |
48 | 53 | ||
@@ -50,17 +55,17 @@ program output, so check out your logs to find them. | |||
50 | 55 | ||
51 | Pull the latest images and rerun PeerTube: | 56 | Pull the latest images and rerun PeerTube: |
52 | 57 | ||
53 | ``` | 58 | ```shell |
54 | $ cd /your/peertube/directory | 59 | $ cd /your/peertube/directory |
55 | $ docker-compose down | 60 | $ docker-compose down |
56 | $ docker-compose pull | 61 | $ docker-compose pull |
57 | $ PEERTUBE_WEBSERVER_HOSTNAME="domain.tld" docker-compose up -d | 62 | $ docker-compose up -d |
58 | ``` | 63 | ``` |
59 | 64 | ||
60 | 65 | ||
61 | ## Build your own Docker image | 66 | ## Build your own Docker image |
62 | 67 | ||
63 | ```bash | 68 | ```shell |
64 | $ git clone https://github.com/chocobozzz/PeerTube /tmp/peertube | 69 | $ git clone https://github.com/chocobozzz/PeerTube /tmp/peertube |
65 | $ cd /tmp/peertube | 70 | $ cd /tmp/peertube |
66 | $ docker build . -f ./support/docker/production/Dockerfile.stretch | 71 | $ docker build . -f ./support/docker/production/Dockerfile.stretch |
@@ -69,4 +74,4 @@ $ docker build . -f ./support/docker/production/Dockerfile.stretch | |||
69 | ## Development | 74 | ## Development |
70 | 75 | ||
71 | We don't have a Docker image for development. See [the CONTRIBUTING guide](https://github.com/Chocobozzz/PeerTube/blob/develop/.github/CONTRIBUTING.md#develop) | 76 | We don't have a Docker image for development. See [the CONTRIBUTING guide](https://github.com/Chocobozzz/PeerTube/blob/develop/.github/CONTRIBUTING.md#develop) |
72 | for more information on how you can hack PeerTube! \ No newline at end of file | 77 | 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 @@ | |||
1 | DB_USERNAME=postgres_user | ||
2 | DB_PASSWORD=postgres_password | ||
3 | PEERTUBE_WEBSERVER_HOSTNAME=my.domain.tld | ||
4 | PEERTUBE_WEBSERVER_PORT=443 | ||
5 | PEERTUBE_WEBSERVER_HTTPS="true" | ||
6 | PEERTUBE_REDIS_HOSTNAME=redis | ||
7 | PEERTUBE_SMTP_USERNAME=null | ||
8 | PEERTUBE_SMTP_PASSWORD=null | ||
9 | PEERTUBE_SMTP_HOSTNAME=null | ||
10 | PEERTUBE_SMTP_PORT=25 | ||
11 | PEERTUBE_SMTP_FROM=noreply@peertube.domain.tld | ||
12 | PEERTUBE_SMTP_TLS="true" | ||
13 | PEERTUBE_ADMIN_EMAIL=admin@domain.tld | ||
14 | PEERTUBE_SIGNUP_ENABLED="true" | ||
15 | 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: | |||
22 | # dockerfile: ./support/docker/production/Dockerfile.stretch | 22 | # dockerfile: ./support/docker/production/Dockerfile.stretch |
23 | image: chocobozzz/peertube:production-stretch | 23 | image: chocobozzz/peertube:production-stretch |
24 | environment: | 24 | environment: |
25 | PEERTUBE_WEBSERVER_HOSTNAME: my.domain.tld | 25 | PEERTUBE_WEBSERVER_HOSTNAME: ${PEERTUBE_WEBSERVER_HOSTNAME} |
26 | PEERTUBE_WEBSERVER_PORT: 443 | 26 | PEERTUBE_WEBSERVER_PORT: ${PEERTUBE_WEBSERVER_PORT} |
27 | PEERTUBE_WEBSERVER_HTTPS: "true" | 27 | PEERTUBE_WEBSERVER_HTTPS: ${PEERTUBE_WEBSERVER_HTTPS} |
28 | PEERTUBE_DB_HOSTNAME: postgres | 28 | PEERTUBE_DB_HOSTNAME: postgres |
29 | PEERTUBE_DB_USERNAME: postgres_user | 29 | PEERTUBE_DB_USERNAME: ${DB_USERNAME} |
30 | PEERTUBE_DB_PASSWORD: postgres_password | 30 | PEERTUBE_DB_PASSWORD: ${DB_PASSWORD} |
31 | PEERTUBE_REDIS_HOSTNAME: redis | 31 | PEERTUBE_REDIS_HOSTNAME: redis |
32 | PEERTUBE_SMTP_USERNAME: null | 32 | PEERTUBE_SMTP_USERNAME: ${PEERTUBE_SMTP_USERNAME} |
33 | PEERTUBE_SMTP_PASSWORD: null | 33 | PEERTUBE_SMTP_PASSWORD: ${PEERTUBE_SMTP_PASSWORD} |
34 | PEERTUBE_SMTP_HOSTNAME: null | 34 | PEERTUBE_SMTP_HOSTNAME: ${PEERTUBE_SMTP_HOSTNAME} |
35 | PEERTUBE_SMTP_PORT: 25 | 35 | PEERTUBE_SMTP_PORT: ${PEERTUBE_SMTP_PORT} |
36 | PEERTUBE_SMTP_FROM: noreply@peertube.domain.tld | 36 | PEERTUBE_SMTP_FROM: ${PEERTUBE_SMTP_FROM} |
37 | PEERTUBE_SMTP_TLS: "true" | 37 | PEERTUBE_SMTP_TLS: ${PEERTUBE_SMTP_TLS} |
38 | # /!\ Prefer to use the PeerTube admin interface to set the following configurations /!\ | 38 | # /!\ Prefer to use the PeerTube admin interface to set the following configurations /!\ |
39 | # PEERTUBE_ADMIN_EMAIL: admin@domain.tld | 39 | # PEERTUBE_ADMIN_EMAIL: ${PEERTUBE_ADMIN_EMAIL} |
40 | # PEERTUBE_SIGNUP_ENABLED: "true" | 40 | # PEERTUBE_SIGNUP_ENABLED: ${PEERTUBE_SIGNUP_ENABLED} |
41 | # PEERTUBE_TRANSCODING_ENABLED: "true" | 41 | # PEERTUBE_TRANSCODING_ENABLED: ${PEERTUBE_TRANSCODING_ENABLED} |
42 | # Traefik labels are suggested as an example for people using Traefik, | 42 | # Traefik labels are suggested as an example for people using Traefik, |
43 | # remove them if you are using another reverse proxy. | 43 | # remove them if you are using another reverse proxy. |
44 | labels: | 44 | labels: |
@@ -59,8 +59,8 @@ services: | |||
59 | postgres: | 59 | postgres: |
60 | image: postgres:10-alpine | 60 | image: postgres:10-alpine |
61 | environment: | 61 | environment: |
62 | POSTGRES_USER: postgres_user | 62 | POSTGRES_USER: ${DB_USERNAME} |
63 | POSTGRES_PASSWORD: postgres_password | 63 | POSTGRES_PASSWORD: ${DB_PASSWORD} |
64 | POSTGRES_DB: peertube | 64 | POSTGRES_DB: peertube |
65 | volumes: | 65 | volumes: |
66 | - ./docker-volume/db:/var/lib/postgresql/data | 66 | - ./docker-volume/db:/var/lib/postgresql/data |
@@ -74,4 +74,4 @@ services: | |||
74 | - ./docker-volume/redis:/data | 74 | - ./docker-volume/redis:/data |
75 | restart: "always" | 75 | restart: "always" |
76 | labels: | 76 | labels: |
77 | traefik.enable: "false" \ No newline at end of file | 77 | traefik.enable: "false" |