How to start test inside docker container from app?
Hi! I'm thinking of building an app similar to leetcode or codewars. The basic idea is user sends you task id and code and I should run tests on it somewhere. I think doing it in docker containers should work. Is it possible to start docker container and pass there input and then somehow get results? Is there a better solution?
10 Replies
Maybe you can try to start the container by passing the environment variable and process it?
thank you, but I don't know how to start it from the app. Should I use
Proccess
?You can simply run the
docker
command and store the output into a file based on what kind of output you need.Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
TeBeCo
REPL Result: Success
Result: bool
Compile: 142.761ms | Execution: 16.556ms | React with ❌ to remove this embed.
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Thanks for the detailed answer, I'll look into this project.
I don’t yet have a specific plan for how this will work, I’m developing ideas, but the main concept is that I create unit tests in advance for each task (maybe a separate project with tests) and run it somewhere and send back the results to the user
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
For now, I will try to make the user wait until the new container starts and check their code
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View