The pricing of the app platform starts with $5. And I do need a cronjob component for my Laravel apps, though each cronjob component is $5. To set up my (D)TAP envs (3 envs) I need 3x this component. Is this the only way to go, or is there a way to share this component on all my apps or only the (D)TAP envs?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Just to clarify, we don’t have a cronjob type of component available on App Platform yet, so I assume you are using a worker and orchestrating the cron job yourself.

As far as supporting your various environments in the cron job, you would need to create a separate component and modify the environment variables accordingly for each component. We don’t have any concept like environments to accomplish what you described above.

The only other option I can think of would be to pass in all relevant environment variables (possibly with a prefix like STAGING_...) and then orchestrate your cronjob to be able to handle of the various types of environment variables based on the prefix.

  • So if I understand correctly, If I want to use 1 worker component (for executing cronjobs) for multiple projects/applications, I should create an application that will connect to the different projects and their components and execute the cronjobs I want. Is it possible in this way I explained or did I misunderstand? If I misunderstood, could you explain a little more?

    • It is not natively supported in app platform, but if you could orchestrate your cronjob such that it could handle running the job against all the corresponding applications in a single process, then you might be able to accomplish that.

      The preferred way would be to set up multiple cronjob components (one for each application) to handle your workloads and give each the corresponding set of env variable values.

      It is also worth mentioning, you cannot access other components from different applications over the private network. You would have to have publicly accessible routes if you were trying to communicate with them