docker-compose.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. version: '2'
  2. services:
  3. postgres:
  4. image: postgres:9.6
  5. container_name: postgres
  6. environment:
  7. POSTGRES_USER: netbox
  8. POSTGRES_PASSWORD: J5brHrAXFLQSif0K
  9. POSTGRES_DB: netbox
  10. netbox:
  11. build: .
  12. links:
  13. - postgres
  14. container_name: netbox
  15. depends_on:
  16. - postgres
  17. environment:
  18. SUPERUSER_NAME: admin
  19. SUPERUSER_EMAIL: admin@example.com
  20. SUPERUSER_PASSWORD: admin
  21. ALLOWED_HOSTS: localhost
  22. DB_NAME: netbox
  23. DB_USER: netbox
  24. DB_PASSWORD: J5brHrAXFLQSif0K
  25. DB_HOST: postgres
  26. SECRET_KEY: r8OwDznj!!dci#P9ghmRfdu1Ysxm0AiPeDCQhKE+N_rClfWNj
  27. EMAIL_SERVER: localhost
  28. EMAIL_PORT: 25
  29. EMAIL_USERNAME: foo
  30. EMAIL_PASSWORD: bar
  31. EMAIL_TIMEOUT: 10
  32. EMAIL_FROM: netbox@bar.com
  33. NETBOX_USERNAME: guest
  34. NETBOX_PASSWORD: guest
  35. volumes:
  36. - $PWD/netbox/netbox/configuration.docker.py:/opt/netbox/netbox/netbox/configuration.py:ro
  37. - $PWD/docker/gunicorn_config.py:/opt/netbox/gunicorn_config.py:ro
  38. - netbox-static-files:/opt/netbox/netbox/static
  39. nginx:
  40. image: nginx:1.11.1-alpine
  41. links:
  42. - netbox
  43. container_name: nginx
  44. depends_on:
  45. - netbox
  46. ports:
  47. - 80:80
  48. volumes:
  49. - $PWD/docker/nginx.conf:/etc/nginx/nginx.conf:ro
  50. volumes_from:
  51. - netbox
  52. volumes:
  53. netbox-static-files:
  54. driver: local