docker-compose.yml 2.3 KB

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