]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - support/doc/docker.md
Misc. typos
[github/Chocobozzz/PeerTube.git] / support / doc / docker.md
... / ...
CommitLineData
1# Docker guide
2
3You can quickly get a server running using Docker. You need to have
4[docker](https://www.docker.com/community-edition) and
5[docker-compose](https://docs.docker.com/compose/install/) installed.
6
7## Production
8
9### Build your own Docker image
10
11```bash
12$ git clone https://github.com/chocobozzz/PeerTube /tmp/peertube
13$ cd /tmp/peertube
14$ docker build . -f ./support/docker/production/Dockerfile.stretch
15```
16
17### Run a preconfigured setup with all dependencies
18
19PeerTube needs a PostgreSQL and a Redis instance to work correctly. If you want
20to quickly set up a full environment, either for trying the service or in
21production, you can use a `docker-compose` setup.
22
23```bash
24$ git clone https://github.com/chocobozzz/PeerTube /tmp/peertube
25$ cd /tmp/peertube/support/docker/production
26```
27
28Then tweak the `docker-compose.yml` file there according to your needs. Then
29you can use the regular `up` command to set it up, with possible overrides of
30the environment variables:
31
32```bash
33$ PEERTUBE_HOSTNAME=peertube.lvh.me \
34 PEERTUBE_ADMIN_EMAIL=test@example.com \
35 PEERTUBE_TRANSCODING_ENABLED=true \
36 PEERTUBE_SIGNUP_ENABLED=true \
37 PEERTUBE_SMTP_HOST=mail.lvh.me \
38 PEERTUBE_SMTP_PORT=1025 \
39 PEERTUBE_SMTP_FROM=noreply@peertube.lvh.me \
40 docker-compose up
41```
42
43Other environment variables are used in
44`support/docker/production/config/custom-environment-variables.yaml` and can be
45intuited from usage.
46
47For this example configuration, a reverse proxy is quite recommended. The
48example Docker Compose file provides example labels for a Traefik load
49balancer, although any HTTP reverse proxy will work fine. See the example
50Nginx configuration `support/nginx/peertube` file to get an idea of
51recommendations and requirements to run PeerTube the most efficiently.
52
53When starting the containers for the first time, you will get permissions errors for the data volume, like this one:
54
55```
56Error: EACCES: permission denied, mkdir '/data/logs'
57```
58
59The peertube user inside the container has a UID and GID of 991 so you have to change the folder's owner, in the case you're using `./data`:
60
61```
62chown -R 991:991 data/
63```
64
65**Important**: note that you'll get the initial `root` user password from the
66program output, so check out your logs to find them.
67
68## Development
69
70The Docker image that's preconfigured in `support/docker/dev` contains all the
71services embedded in one image, so as to work correctly on
72[Janitor](https://janitor.technology). It is much not advised to use it in
73production.