Also i have a question on referencing files such as bash files
when i use %S/bin/test.sh i get an error of file not found or executable yet i had made chmod +x test.sh
is there a proper way to reference files
Also i have a question on referencing files such as bash files
when i use %S/bin/test.sh i get an error of file not found or executable yet i had made chmod +x test.sh
is there a proper way to reference files
I noticed SELinux prevents Systemd from running commands from directories other than /usr/bin or similar.
As your command is a shell script run it like /bin/bash test.sh.
Okay
here is an example of a docker compose service
So first we create a bash file inside bin configurator and put the contents below
after that we create a service to handle and run the configurator
when i run this i get the error file does not exist or is not executable
So should i use %S/bin/filename or filename
I think the issue is behind trying to execute %S/bin/configurator
inside the container, which is exactly what is being asked, but there’s no %S/bin/configurator
inside the container, it’s only outside in the module, so the container cannot access it.
You can, however, from reading in the documentation of the image you’re using, that you’ll better off setting the variables with the -e
append with the named variable of your choice.
So, the changes needed are the following:
--entrypoint '["bash", "-c"] \
, it’s not needed, configurator will runset-config
using -e
, for example: bench set-config -g db_host $$DB_HOST
becomes -e DB_HOST=<yourvaluehere>
%S/bin/configurator
after the image variableAfter this it might run, however I have no knowledge of this containerized environment and haven’t tested it myself
So actually if i remove the %S/bin/configurator
it will run the default entry point.
So for us we need first to set the configure the site using the script file configurator so as the application to work
Sure, however configurator can and will pick up the environment variables as per doc given by frappe
: frappe_docker/docs/environment-variables.md at main · frappe/frappe_docker · GitHub, maybe the issue is that they’re using the same image for multiple runtimes, if that’s so you can just --entrypoint '["bash", "-c", "exit", "0"] \
and it should load the environment. But something else appears to be going on behind the curtains (I see a gunicorn
command and a ton of parameters)
Yes, this is because the executable node
is inside the container $PATH
and the file /home/frappe/frappe-bench/apps/frappe/socketio.js
exists within the container (it’s mounted using the the volumes -v
)
However there’s no file such as /bin/configurator
inside the container, you can mount it using -v %S/bin/configurator:/bin/configurator:Z
and then write something like ${ERPNET_IMAGE} /bin/configurator
at the end of ExecStart
I don’t suggest it however, containers should be responsible for their own configuration, if not given they should be self sufficient (exiting or generating one or picking data from env)
Okay i think this is a nice way
let ne try then give you a response on how it will be
Now this is working thank you