diff --git a/appspec.yml b/appspec.yml new file mode 100644 index 0000000..3472ebf --- /dev/null +++ b/appspec.yml @@ -0,0 +1,24 @@ +version: 0.0 +os: linux + +files: + - source: / + destination: /home/ubuntu/Server + overwrite: yes +file_exists_behavior: OVERWRITE +permissions: + - object: /home/ubuntu + pattern: '**' + owner: ubuntu + group: root + +hooks: + ApplicationStop: + - location: scripts/stop.sh + runas: ubuntu + AfterInstall: + - location: scripts/initialize.sh + runas: ubuntu + ApplicationStart: + - location: scripts/start.sh + runas: ubuntu \ No newline at end of file diff --git a/scripts/initialize.sh b/scripts/initialize.sh new file mode 100644 index 0000000..bddc158 --- /dev/null +++ b/scripts/initialize.sh @@ -0,0 +1 @@ +git pull \ No newline at end of file diff --git a/scripts/start.sh b/scripts/start.sh new file mode 100644 index 0000000..cfb3d7e --- /dev/null +++ b/scripts/start.sh @@ -0,0 +1,2 @@ +docker-compose build +docker-compose up -d \ No newline at end of file diff --git a/scripts/stop.sh b/scripts/stop.sh new file mode 100644 index 0000000..a99bb2c --- /dev/null +++ b/scripts/stop.sh @@ -0,0 +1,5 @@ +cd /home/ubuntu/Server + +docker-compose down + +docker image prune -a \ No newline at end of file