How do I set up an App worker to run a LUA script?

Currently I have a droplet with a node web server and LUA installed. I also have an APP which runs a second server. Right now the web server executes the LUA app from the shell.

I’d like to move the LUA thing to the second server, and it seems like making it a worker would be the best bet.

Can anyone explain what the process for doing that is? Do I create it from Github or Docker Hub?

I know how to create the worker, and that I need to make it a “Dockerfile build”, but i have no idea how to use that or make it work or how I would send requests there or anything. Would I need to build a LUA web server to receive requests?

Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

i gave up because its too hard to setup

Jon Friesen
DigitalOcean Employee
DigitalOcean Employee badge
November 1, 2022

👋 @skeddtemp

Great question! Workers would be a good fit if you had a LUA app that continuously polled for “work” to do. So if that is looking in the DB for work or reaching out to the node server for more work. The important thing to note here is that workers are going out and finding the work, they cannot have ports exposed, so creating a web server won’t work.

If creating a web server IS what you’re interested in, then you may want to consider an internal service component. This is a service without any publicly accessible ports but internally accessible ones that can be accessed by other app components (like the node server).

As far as how this is created, LUA isn’t supported by App Platform buildpacks, so you’d have to create a dockerfile that has the right depdencies to run lua.

Hope this helps!

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.