docker-compose.yml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. version: "3.3"
  2. services:
  3. # You can comment this webserver section if you want to use another webserver/proxy or test PeerTube in local
  4. webserver:
  5. image: chocobozzz/peertube-webserver:latest
  6. # If you don't want to use the official image and build one from sources:
  7. # build:
  8. # context: .
  9. # dockerfile: Dockerfile.nginx
  10. env_file:
  11. - .env
  12. ports:
  13. - "80:80"
  14. - "443:443"
  15. volumes:
  16. - type: bind
  17. # Switch sources if you downloaded the whole repository
  18. #source: ../../nginx/peertube
  19. source: ./docker-volume/nginx/peertube
  20. target: /etc/nginx/conf.d/peertube.template
  21. - assets:/var/www/peertube/peertube-latest/client/dist:ro
  22. - ./docker-volume/data:/var/www/peertube/storage
  23. - certbot-www:/var/www/certbot
  24. - ./docker-volume/certbot/conf:/etc/letsencrypt
  25. depends_on:
  26. - peertube
  27. restart: "always"
  28. # You can comment this certbot section if you want to use another webserver/proxy or test PeerTube in local
  29. certbot:
  30. container_name: certbot
  31. image: certbot/certbot
  32. volumes:
  33. - ./docker-volume/certbot/conf:/etc/letsencrypt
  34. - certbot-www:/var/www/certbot
  35. restart: unless-stopped
  36. entrypoint: /bin/sh -c "trap exit TERM; while :; do certbot renew --webroot -w /var/www/certbot; sleep 12h & wait $${!}; done;"
  37. depends_on:
  38. - webserver
  39. peertube:
  40. # If you don't want to use the official image and build one from sources:
  41. # build:
  42. # context: .
  43. # dockerfile: ./support/docker/production/Dockerfile.bullseye
  44. image: chocobozzz/peertube:production-bullseye
  45. # Use a static IP for this container because nginx does not handle proxy host change without reload
  46. # This container could be restarted on crash or until the postgresql database is ready for connection
  47. networks:
  48. default:
  49. ipv4_address: 172.18.0.42
  50. env_file:
  51. - .env
  52. ports:
  53. - "1935:1935" # Comment if you don't want to use the live feature
  54. # - "9000:9000" # Uncomment if you use another webserver/proxy or test PeerTube in local, otherwise not suitable for production
  55. volumes:
  56. - assets:/app/client/dist
  57. - ./docker-volume/data:/data
  58. - ./docker-volume/config:/config
  59. depends_on:
  60. - postgres
  61. - redis
  62. - postfix
  63. restart: "always"
  64. postgres:
  65. image: postgres:13-alpine
  66. env_file:
  67. - .env
  68. volumes:
  69. - ./docker-volume/db:/var/lib/postgresql/data
  70. restart: "always"
  71. redis:
  72. image: redis:6-alpine
  73. volumes:
  74. - ./docker-volume/redis:/data
  75. restart: "always"
  76. postfix:
  77. image: mwader/postfix-relay
  78. env_file:
  79. - .env
  80. volumes:
  81. - ./docker-volume/opendkim/keys:/etc/opendkim/keys
  82. restart: "always"
  83. networks:
  84. default:
  85. ipam:
  86. driver: default
  87. config:
  88. - subnet: 172.18.0.0/16
  89. volumes:
  90. assets:
  91. certbot-www: