docker-compose.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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/
  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. hmac_key: "CHANGE_ME!!"
  32. healthcheck:
  33. test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/trending || exit 1
  34. interval: 30s
  35. timeout: 5s
  36. retries: 2
  37. invidious-db:
  38. image: docker.io/library/postgres:14
  39. restart: unless-stopped
  40. volumes:
  41. - postgresdata:/var/lib/postgresql/data
  42. - ./config/sql:/config/sql
  43. - ./docker/init-invidious-db.sh:/docker-entrypoint-initdb.d/init-invidious-db.sh
  44. environment:
  45. POSTGRES_DB: invidious
  46. POSTGRES_USER: kemal
  47. POSTGRES_PASSWORD: kemal
  48. healthcheck:
  49. test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
  50. volumes:
  51. postgresdata: