Closed PierceNg closed 4 years ago
Hi @PierceNg, thanks for providing such full steps! I have never tried Sagui/Brook on Alpine before, so I'm very happy to see them working fine in such a minimal system. :-)
Regarding the problem you are getting, it seems not related to Brook. In general, to run a console application in a container in non interactive mode, the application needs to avoid to exit prematurely after getting executed, so maybe using something like TSimpleEvent.WaitFor(INFINITE)
would help you to do that for any platform. For example, something like this.
Let me know if the information above helps you to solve the problem.
Hi @silvioprog. I came to Brook Framework after doing the same Alpine Docker thing with fcl-web and BrookFreePascal. Based on your reply I now realize I made some assumptions without reading the code. :-P Now that I know the example is literally a console program, I will be able to daemonize it.
Environment:
Program works on command line:
In another terminal window:
Dockerfile:
Build and tag as
helloworld:brook4
:The resulting Docker container exits immediately though:
But running the Docker container interactively (by using
-it
option and runningsh
) works:In another terminal window:
And running with
-it
option todocker run
works too:In another terminal window:
Not sure if this counts as a bug; I've not encountered the need to use '-it' option when dockerizing other server-type programs.
Reference: My posts to Lazarus forum that also talk about fcl-web and BrookFreePascal that have pure Pascal HTTP servers.