Guest User

Untitled

a guest
Dec 14th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. # The worker containers simply execute the Laravel artisan queue:work
  2. # command instead of php-fpm
  3. TaskDefinitionWorker:
  4. Type: AWS::ECS::TaskDefinition
  5. Properties:
  6. Family: laravel-workers
  7. ContainerDefinitions:
  8. - Name: app
  9. Essential: true
  10. Image: !Join [ ".", [ !Ref "AWS::AccountId", "dkr.ecr", !Ref "AWS::Region", !Join [ ":", [ !Join [ "/", [ "amazonaws.com", !Ref ECR ] ], "laravel" ] ] ] ]
  11. Command:
  12. - "/bin/sh"
  13. - "-c"
  14. - "php artisan queue:work"
  15. Memory: 128
  16. LogConfiguration:
  17. LogDriver: awslogs
  18. Options:
  19. awslogs-group: !Ref AWS::StackName
  20. awslogs-region: !Ref AWS::Region
  21. Environment:
  22. - Name: APP_NAME
  23. Value: Laravel
  24. ......
  25.  
  26. # The cron container command is a bit more intricate
  27. # since we need to load the container's environment
  28. # variables in the same console session context than cron
  29. # for Laravel to use them
  30. TaskDefinitionCron:
  31. Type: AWS::ECS::TaskDefinition
  32. Properties:
  33. Family: laravel-cron
  34. ContainerDefinitions:
  35. - Name: app
  36. Essential: true
  37. Image: !Join [ ".", [ !Ref "AWS::AccountId", "dkr.ecr", !Ref "AWS::Region", !Join [ ":", [ !Join [ "/", [ "amazonaws.com", !Ref ECR ] ], "laravel" ] ] ] ]
  38. EntryPoint:
  39. - /bin/bash
  40. - -c
  41. Command:
  42. - env /bin/bash -o posix -c 'export -p' > /etc/cron.d/project_env.sh && chmod +x /etc/cron.d/project_env.sh && crontab /etc/cron.d/artisan-schedule-run && cron && tail -f /var/log/cron.log
  43. Memory: 128
  44. LogConfiguration:
  45. LogDriver: awslogs
  46. Options:
  47. awslogs-group: !Ref AWS::StackName
  48. awslogs-region: !Ref AWS::Region
  49. Environment:
  50. - Name: APP_NAME
  51. Value: Laravel
Add Comment
Please, Sign In to add comment