From within your dockerfile, simply use cpan or cpanm to add App::aep It should then be possible to use 'aep' as the entrypoint in the dockerfile Please see the EXAMPLES section for a small dockerfile to create a working example
This app is a dynamic entry point for use in container systems such as docker, unlike most perl modules, this has been created to correctly react to signals so it will respond correctly.
Signals passed to this entrypoint will also be passed down to the child.
Default value: disabled
Only read command line options from the enviroment
Only listen to command line arguments
Default value: enabled
Merge together env, config and args to generate a config
Default value: 'env,conf,args' (left to right)
The order to merge options together,
Default value: aep-
When scanning the enviroment aep will look for this prefix to know which environment variables it should pay attention to.
What to actually run within the container, default is print aes help.
The arguments to add to the command comma seperated, default is nothing.
Example: --list,--as-service,--with-long "arg",--foreground
If the command exits how many times to retry it, default 0 set to -1 for infinate
The time in milliseconds to wait before retrying the command, default 1000
These are for if you have concerns of 'race' conditions.
Act like a lock server, this means we will expect other aeps to connect to us, we in turn will say when they should actually start, this is to counter-act race issues when starting multi image containers such as docker-compose.
What host to bind to, defaults to 0.0.0.0
What port to bind to, defaults to 60000
If we get sent an ID we do not know what to do with, tell it to run.
If we get sent an ID we do not know what to do with, ignore it.
The list of ids and the order to allow them to run, allows OR || operators, for example: db,redis1||redis2,redis1||redis2,nginx
Beware the the lock-server-default-ignore config flag!
Default value: idle
What to do if all clients have been started (list end), options are:
exit- Exit 0
idle - Do nothing, just sit there doing nothing
restart - Reset the lock-server-order list and continue operating
execute - Read in any passed commands and args and run them like a normal aep
Become a lock client, this will mean your aep will connect to another aep to learn when it should run its command.
What host to connect to, defaults to 'aep-master'
What port to connect to, defaults to 60000
Default: none:time:10000
What to look for to know that our target command has executed correctly, if the target command dies or exits before this filter can complete, the success will never be reported, if you have also set restart options the lock-trigger will continue to try to validate the service.
The syntax for the filters is:
handle:filter:specification
handle can be stderr, stdout, both or none
So an example for a filter that will match 'now serving requests':
both:text:now serving requests
Several standard filters are availible:
time - Wait this many milliseconds and then report success.
Example: none:time:2000
regex - Wait till this regex matches to report success.
Example: both:regex:ok|success
text - Wait till this line of text is seen.
Example: both:text:success
script - Run a script or binary somewhere else on the system and use its exit code to determine success or failure.
Example: none:script:/opt/check_state
connect - Try to connect to a tcp port, no data is sent and any recieved is ignored. Will be treated as success if the connect its self succeeds.
Example: none:connect:127.0.0.1:6767
What ID we should say we are
For any feature requests or bug reports please visit:
* Github https://github.com/PaulGWebster/p5-App-aep
You may also catch up to the author 'daemon' on IRC:
* irc.libera.org
* #perl
Paul G Webster <daemon@cpan.org>
This software is copyright (c) 2023 by Paul G Webster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install App::aep, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::aep
CPAN shell
perl -MCPAN -e shell install App::aep
For more information on module installation, please visit the detailed CPAN module installation guide.