You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.9 KiB

  1. version: "3.8"
  2. # Docker compose recipe for InvenTree
  3. # - Runs PostgreSQL as the database backend
  4. # - Runs Gunicorn as the InvenTree web server
  5. # - Runs the InvenTree background worker process
  6. # - Runs nginx as a reverse proxy
  7. # ---------------------------------
  8. # IMPORTANT - READ BEFORE STARTING!
  9. # ---------------------------------
  10. # Before running, ensure that you change the "/path/to/data" directory,
  11. # specified in the "volumes" section at the end of this file.
  12. # This path determines where the InvenTree data will be stored!
  13. #
  14. services:
  15. # InvenTree web server services
  16. # Uses gunicorn as the web server
  17. core:
  18. container_name: ${INVENTREE_CORE_CONTAINER_NAME:-inventree_core}
  19. image: inventree/inventree:${INVENTREE_VERSION:-latest}
  20. restart: unless-stopped
  21. expose:
  22. - 8000
  23. volumes:
  24. - ./data:/home/inventree/data
  25. environment:
  26. INVENTREE_DEBUG: False
  27. INVENTREE_LOG_LEVEL: WARNING
  28. INVENTREE_DB_ENGINE: mysql
  29. INVENTREE_DB_HOST: ${INVENTREE_DB_HOST:?err}
  30. INVENTREE_DB_PORT: ${INVENTREE_DB_PORT:?err}
  31. INVENTREE_DB_NAME: ${INVENTREE_DB_NAME:?err}
  32. INVENTREE_DB_USER: ${INVENTREE_DB_USER:?err}
  33. INVENTREE_DB_PASSWORD: ${INVENTREE_DB_PASSWORD:?err}
  34. # Background worker process handles long-running or periodic tasks
  35. worker:
  36. container_name: ${INVENTREE_WORKER_CONTAINER_NAME:-inventree_worker}
  37. image: inventree/inventree:${INVENTREE_VERSION:-latest}
  38. restart: unless-stopped
  39. command: invoke worker
  40. depends_on:
  41. - core
  42. volumes:
  43. - ./data:/home/inventree/data
  44. environment:
  45. INVENTREE_DEBUG: False
  46. INVENTREE_LOG_LEVEL: WARNING
  47. INVENTREE_DB_ENGINE: mysql
  48. INVENTREE_DB_HOST: ${INVENTREE_DB_HOST:?err}
  49. INVENTREE_DB_PORT: ${INVENTREE_DB_PORT:?err}
  50. INVENTREE_DB_NAME: ${INVENTREE_DB_NAME:?err}
  51. INVENTREE_DB_USER: ${INVENTREE_DB_USER:?err}
  52. INVENTREE_DB_PASSWORD: ${INVENTREE_DB_PASSWORD:?err}
  53. # nginx acts as a reverse proxy
  54. # static files are served directly by nginx
  55. # media files are served by nginx, although authentication is redirected to inventree-server
  56. # web requests are redirected to gunicorn
  57. # NOTE: You will need to provide a working nginx.conf file!
  58. proxy:
  59. container_name: ${INVENTREE_PROXY_CONTAINER_NAME:-inventree_proxy}
  60. image: nginx:${INVENTREE_PROXY_VERSION:-stable}
  61. restart: unless-stopped
  62. depends_on:
  63. - core
  64. ports:
  65. - ${INVENTREE_HOST_IP_ADDRESS:-127.0.0.1}:${INVENTREE_HOST_PORT:-1337}:80
  66. volumes:
  67. # Provide ./nginx.conf file to the container
  68. # Refer to the provided example file as a starting point
  69. - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
  70. - ./data:/var/www