]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - support/docker/production/docker-compose.yml
Fix docker-compose setup so Peertube sees correct IP
[github/Chocobozzz/PeerTube.git] / support / docker / production / docker-compose.yml
1 version: "3.3"
2
3 services:
4
5 reverse-proxy:
6 image: traefik
7 network_mode: "host"
8 command: --docker # Tells Træfik to listen to docker
9 ports:
10 - "80:80" # The HTTP port
11 - "443:443" # The HTTPS port
12 volumes:
13 - /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
14 - ./docker-volume/traefik/acme.json:/etc/acme.json
15 - ./docker-volume/traefik/traefik.toml:/traefik.toml
16 restart: "always"
17 # If you want to use the Traefik dashboard, you should expose it on a
18 # subdomain with HTTPS and authentification:
19 # https://medium.com/@xavier.priour/secure-traefik-dashboard-with-https-and-password-in-docker-5b657e2aa15f
20 # https://github.com/containous/traefik/issues/880#issuecomment-310301168
21
22 peertube:
23 # If you don't want to use the official image and build one from sources
24 # build:
25 # context: .
26 # dockerfile: ./support/docker/production/Dockerfile.stretch
27 image: chocobozzz/peertube:production-stretch
28 env_file:
29 - .env
30 # Traefik labels are suggested as an example for people using Traefik,
31 # remove them if you are using another reverse proxy.
32 labels:
33 traefik.enable: "true"
34 traefik.frontend.rule: "Host:${PEERTUBE_WEBSERVER_HOSTNAME}"
35 traefik.port: "9000"
36 # If you don't want to use a reverse proxy (not suitable for production!)
37 # ports:
38 # - "80:9000"
39 volumes:
40 - ./docker-volume/data:/data
41 - ./docker-volume/config:/config
42 depends_on:
43 - postgres
44 - redis
45 - postfix
46 restart: "always"
47
48 postgres:
49 image: postgres:10-alpine
50 environment:
51 POSTGRES_USER: ${PEERTUBE_DB_USERNAME}
52 POSTGRES_PASSWORD: ${PEERTUBE_DB_PASSWORD}
53 POSTGRES_DB: peertube
54 volumes:
55 - ./docker-volume/db:/var/lib/postgresql/data
56 restart: "always"
57 labels:
58 traefik.enable: "false"
59
60 redis:
61 image: redis:4-alpine
62 volumes:
63 - ./docker-volume/redis:/data
64 restart: "always"
65 labels:
66 traefik.enable: "false"
67
68 postfix:
69 image: mwader/postfix-relay
70 environment:
71 - POSTFIX_myhostname=${PEERTUBE_WEBSERVER_HOSTNAME}
72 labels:
73 traefik.enable: "false"
74 restart: "always"
75
76 networks:
77 default:
78 ipam:
79 driver: default
80 config:
81 - subnet: 172.18.0.0/16