docker-compose.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. version: '3.8'
  2. services:
  3. # Complete Inventory Solution (Single Container)
  4. inventory-app:
  5. build:
  6. context: .
  7. dockerfile: Dockerfile
  8. container_name: inventory-app
  9. ports:
  10. - "${FRONTEND_PORT:-80}:80"
  11. environment:
  12. - DB_HOST=${DB_HOST}
  13. - DB_PORT=${DB_PORT:-3306}
  14. - DB_NAME=${DB_NAME}
  15. - DB_USER=${DB_USER}
  16. - DB_PASS=${DB_PASS}
  17. - COMPANY_NAME=${COMPANY_NAME:-Inventory Management}
  18. - COMPANY_ADDRESS=${COMPANY_ADDRESS:-123 Business St}
  19. - COMPANY_CITY=${COMPANY_CITY:-Helsinki}
  20. - COMPANY_POSTAL_CODE=${COMPANY_POSTAL_CODE:-00100}
  21. - COMPANY_COUNTRY=${COMPANY_COUNTRY:-Finland}
  22. - COMPANY_PHONE=${COMPANY_PHONE:-+358 123 456 789}
  23. - COMPANY_EMAIL=${COMPANY_EMAIL:-info@company.com}
  24. - COMPANY_Y_TUNNUS=${COMPANY_Y_TUNNUS:-1234567-8}
  25. - UPLOAD_MAX_SIZE=${UPLOAD_MAX_SIZE:-10M}
  26. - ALLOWED_FILE_TYPES=${ALLOWED_FILE_TYPES:-pdf,doc,docx,xls,xlsx,jpg,jpeg,png,gif}
  27. volumes:
  28. - ./uploads:/var/www/html/uploads
  29. - ./attachments:/var/www/html/attachments
  30. restart: unless-stopped
  31. healthcheck:
  32. test: ["CMD", "curl", "-f", "http://localhost/api/company.php"]
  33. interval: 30s
  34. timeout: 10s
  35. retries: 3
  36. start_period: 40s
  37. # Redis Cache Service (Optional)
  38. redis:
  39. image: redis:7-alpine
  40. container_name: inventory-redis
  41. ports:
  42. - "${REDIS_PORT:-6379}:6379"
  43. volumes:
  44. - redis_data:/data
  45. restart: unless-stopped
  46. command: redis-server --appendonly yes
  47. volumes:
  48. redis_data:
  49. driver: local
  50. uploads_data:
  51. driver: local
  52. driver_opts:
  53. type: none
  54. o: bind
  55. device: ${UPLOADS_PATH:-./uploads}