]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - support/docker/production/docker-compose.yml
Add nginx behind traefik in docker-compose + image updates
[github/Chocobozzz/PeerTube.git] / support / docker / production / docker-compose.yml
CommitLineData
e8395f02 1version: "3.3"
2
3services:
e8395f02 4
1a9b141d
RK
5 # The reverse-proxy only does SSL termination and automatic certificate generation. You can
6 # replace it with any other reverse-proxy, in which case you can remove 'traefik.*' labels.
b44a9630 7 reverse-proxy:
f1b38883 8 image: traefik:v1.7
f2e0cca9 9 network_mode: "host"
e962e1c3 10 command:
1a9b141d
RK
11 - "--docker" # Tells Træfik to listen to docker
12 - "--acme.email=${TRAEFIK_ACME_EMAIL}" # Let's Encrypt ACME email
13 - "--acme.domains=${TRAEFIK_ACME_DOMAINS}" # Let's Encrypt ACME domain list
b44a9630 14 ports:
1a9b141d
RK
15 - "80:80" # The HTTP port
16 - "443:443" # The HTTPS port
b44a9630 17 volumes:
1a9b141d 18 - /var/run/docker.sock:/var/run/docker.sock # So that Træfik can listen to the Docker events
b44a9630
C
19 - ./docker-volume/traefik/acme.json:/etc/acme.json
20 - ./docker-volume/traefik/traefik.toml:/traefik.toml
21 restart: "always"
22
1a9b141d
RK
23 # The webserver is not required, but recommended since a lot of optimizations went to its
24 # nginx configuration file. It runs the default nginx configuration without HTTPS nor SSL,
25 # so use it in production in tandem with an SSL-terminating reverse-proxy like above.
26 webserver:
27 build:
28 context: .
29 dockerfile: Dockerfile.nginx
08c11bec
C
30 env_file:
31 - .env
1a9b141d
RK
32 # If you provide your own reverse-proxy, otherwise not suitable for production:
33 #ports:
34 # - "80:80"
35 volumes:
36 - type: bind
37 # Switch sources if you downloaded the nginx configuration without the whole repository
38 #source: ./peertube
39 source: ../../nginx/peertube
40 target: /etc/nginx/conf.d/peertube.template
41 - assets:/var/www/peertube/peertube-latest/client/dist:ro
42 - ./docker-volume/data:/var/www/peertube/storage
43 depends_on:
44 - peertube
45 restart: "always"
e8395f02 46 labels:
47 traefik.enable: "true"
fd5e57bb 48 traefik.frontend.rule: "Host:${PEERTUBE_WEBSERVER_HOSTNAME}"
1a9b141d
RK
49 traefik.port: "80"
50
51 peertube:
52 # If you don't want to use the official image and build one from sources:
53 #build:
54 # context: .
55 # dockerfile: ./support/docker/production/Dockerfile.buster
56 image: chocobozzz/peertube:production-buster
57 env_file:
58 - .env
59 # If you provide your own webserver and reverse-proxy, otherwise not suitable for production:
60 #ports:
61 # - "80:9000"
e8395f02 62 volumes:
1a9b141d 63 - assets:/app/client/dist
fd5e57bb
C
64 - ./docker-volume/data:/data
65 - ./docker-volume/config:/config
e8395f02 66 depends_on:
ef48a0d5
BB
67 - postgres
68 - redis
fef13f14 69 - postfix
ef48a0d5 70 restart: "always"
1a9b141d
RK
71 labels:
72 traefik.enable: "false"
e8395f02 73
ef48a0d5 74 postgres:
0c49373a 75 image: postgres:10-alpine
e2882b2c
L
76 env_file:
77 - .env
e8395f02 78 volumes:
fd5e57bb 79 - ./docker-volume/db:/var/lib/postgresql/data
ef48a0d5 80 restart: "always"
b44a9630
C
81 labels:
82 traefik.enable: "false"
ef48a0d5
BB
83
84 redis:
1a9b141d 85 image: redis:5-alpine
ef48a0d5 86 volumes:
fd5e57bb 87 - ./docker-volume/redis:/data
ef48a0d5 88 restart: "always"
b44a9630 89 labels:
f83e339b 90 traefik.enable: "false"
fef13f14
FA
91
92 postfix:
93 image: mwader/postfix-relay
e2882b2c
L
94 env_file:
95 - .env
cd7ec86f 96 volumes:
97 - ./docker-volume/opendkim/keys:/etc/opendkim/keys
fef13f14
FA
98 labels:
99 traefik.enable: "false"
100 restart: "always"
1bab2bbc
FA
101
102networks:
103 default:
104 ipam:
105 driver: default
106 config:
107 - subnet: 172.18.0.0/16
1a9b141d
RK
108
109volumes:
110 assets: