]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - 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
CommitLineData
e8395f02 1version: "3.3"
2
3services:
e8395f02 4
b44a9630
C
5 reverse-proxy:
6 image: traefik
f2e0cca9 7 network_mode: "host"
fef13f14 8 command: --docker # Tells Træfik to listen to docker
b44a9630
C
9 ports:
10 - "80:80" # The HTTP port
11 - "443:443" # The HTTPS port
b44a9630
C
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"
f2e0cca9 17 # If you want to use the Traefik dashboard, you should expose it on a
fef13f14
FA
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
b44a9630 21
ef48a0d5 22 peertube:
13a6b536
C
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
779f0000 27 image: chocobozzz/peertube:production-stretch
08c11bec
C
28 env_file:
29 - .env
e8395f02 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"
fd5e57bb 34 traefik.frontend.rule: "Host:${PEERTUBE_WEBSERVER_HOSTNAME}"
e8395f02 35 traefik.port: "9000"
4aeb67a5
C
36 # If you don't want to use a reverse proxy (not suitable for production!)
37 # ports:
38 # - "80:9000"
e8395f02 39 volumes:
fd5e57bb
C
40 - ./docker-volume/data:/data
41 - ./docker-volume/config:/config
e8395f02 42 depends_on:
ef48a0d5
BB
43 - postgres
44 - redis
fef13f14 45 - postfix
ef48a0d5 46 restart: "always"
e8395f02 47
ef48a0d5 48 postgres:
0c49373a 49 image: postgres:10-alpine
e8395f02 50 environment:
08c11bec
C
51 POSTGRES_USER: ${PEERTUBE_DB_USERNAME}
52 POSTGRES_PASSWORD: ${PEERTUBE_DB_PASSWORD}
ef48a0d5 53 POSTGRES_DB: peertube
e8395f02 54 volumes:
fd5e57bb 55 - ./docker-volume/db:/var/lib/postgresql/data
ef48a0d5 56 restart: "always"
b44a9630
C
57 labels:
58 traefik.enable: "false"
ef48a0d5
BB
59
60 redis:
0c49373a 61 image: redis:4-alpine
ef48a0d5 62 volumes:
fd5e57bb 63 - ./docker-volume/redis:/data
ef48a0d5 64 restart: "always"
b44a9630 65 labels:
f83e339b 66 traefik.enable: "false"
fef13f14
FA
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"
1bab2bbc
FA
75
76networks:
77 default:
78 ipam:
79 driver: default
80 config:
81 - subnet: 172.18.0.0/16