docker-compose.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Warning: This docker-compose file is made for development purposes.
  2. # Using it will build an image from the locally cloned repository.
  3. #
  4. # If you want to use Invidious in production, see the docker-compose.yml file provided
  5. # in the installation documentation: https://docs.invidious.io/Installation.md
  6. version: "3"
  7. services:
  8. invidious:
  9. build:
  10. context: .
  11. dockerfile: docker/Dockerfile
  12. restart: unless-stopped
  13. ports:
  14. - "127.0.0.1:3000:3000"
  15. environment:
  16. # Please read the following file for a comprehensive list of all available
  17. # configuration options and their associated syntax:
  18. # https://github.com/iv-org/invidious/blob/master/config/config.example.yml
  19. INVIDIOUS_CONFIG: |
  20. db:
  21. dbname: invidious
  22. user: kemal
  23. password: kemal
  24. host: invidious-db
  25. port: 5432
  26. check_tables: true
  27. # external_port:
  28. # domain:
  29. # https_only: false
  30. # statistics_enabled: false
  31. healthcheck:
  32. test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/comments/jNQXAC9IVRw || exit 1
  33. interval: 30s
  34. timeout: 5s
  35. retries: 2
  36. depends_on:
  37. - invidious-db
  38. invidious-db:
  39. image: docker.io/library/postgres:14
  40. restart: unless-stopped
  41. volumes:
  42. - postgresdata:/var/lib/postgresql/data
  43. - ./config/sql:/config/sql
  44. - ./docker/init-invidious-db.sh:/docker-entrypoint-initdb.d/init-invidious-db.sh
  45. environment:
  46. POSTGRES_DB: invidious
  47. POSTGRES_USER: kemal
  48. POSTGRES_PASSWORD: kemal
  49. healthcheck:
  50. test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
  51. volumes:
  52. postgresdata: