-
-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a systemd service to launch giskard at boot on AWS machines
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# this is a systemd service, to be put in /usr/lib/systemd/system | ||
# and enabled with 'sudo systemctl enable giskard-docker-start-service' | ||
[Unit] | ||
Description=Docker Compose Giskard starter | ||
After=docker.service network-online.target | ||
Requires=docker.service network-online.target | ||
|
||
[Service] | ||
WorkingDirectory=/home/ec2-user | ||
Type=oneshot | ||
RemainAfterExit=yes | ||
|
||
# change this to branch main before merging | ||
ExecStartPre=-/bin/bash -c "/bin/curl -f 'https://raw.githubusercontent.com/Giskard-AI/giskard/feat/ami/docker-compose.ami.yml' -o docker-compose.ami.yml" | ||
ExecStartPre=-/bin/bash -c "/bin/curl -f 'https://raw.githubusercontent.com/Giskard-AI/giskard/main/docker-compose.yml' -o docker-compose.yml" | ||
ExecStartPre=-/usr/local/bin/docker-compose pull --quiet | ||
ExecStart=/usr/local/bin/docker-compose -f docker-compose.yml -f docker-compose.ami.yml up -d | ||
|
||
ExecStartPost=/bin/bash -c "echo 'Pruning docker images...'" | ||
ExecStartPost=-docker image prune -f | ||
|
||
ExecStop=/usr/local/bin/docker-compose down | ||
|
||
[Install] | ||
WantedBy=multi-user.target |