bitovi/github-actions-deploy-docker-to-ec2

Custom pre-hook scripts before 'docker-compose up'

arm4b opened this issue · 3 comments

arm4b commented

Spot this as a requirement while working on the https://github.com/bitovi/chaoss-config/pull/5.

Sometimes in order to run an app properly there is a need to execute a few scripts.
For instance, it could be some preparation steps like changing the sysctl settings on the host or setting the folder permissions on the host machine for shared data dirs.

With that, allowing to run some pre-hooks from the user's repository would be great.

arm4b commented

Alternatively, one of the ways to run something on instance startup is injecting the EC2 User data where I could insert some bash commands inline.

See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html

Why not just run via docker ? you say u need to configure something in the machine properly, correct ?

ec2_user_data_file added for this reason. Even if Ansible is set not to run.