diff --git a/playbooks/code-deploy.yml b/playbooks/code-deploy.yml index 1dda536..a49f6ff 100644 --- a/playbooks/code-deploy.yml +++ b/playbooks/code-deploy.yml @@ -14,7 +14,7 @@ command: chdir=/root/wrestlingApp docker build -t wrestlingdev-web -f rails-prod-Dockerfile . - name: Kill running docker container - command: docker kill wrestlingdev-web + shell: docker stop $(docker ps -a -q) - name: Start docker container command: docker run -h {{ansible_hostname}} -d --restart=always --env-file /root/prod.env -v /srv/docker/apache2/logs:/var/log/apache2 -v /etc/localtime:/etc/localtime -p 80:80 -p 443:443 wrestlingdev-web @@ -28,10 +28,10 @@ command: chdir=/root/wrestlingApp git pull origin master - name: Create apache docker image - command: chdir=/root/wrestlingApp docker build -t wrestlingdev-web -f rails-prod-Dockerfile . + command: chdir=/root/wrestlingApp docker build -t wrestlingdev-worker -f rails-prod-Dockerfile . - name: Kill running docker container - command: docker kill wrestlingdev-web + shell: docker stop $(docker ps -a -q) - name: Start docker container command: docker run -h {{ansible_hostname}} -d --restart=always --env-file /root/prod.env -v /etc/localtime:/etc/localtime wrestlingdev-worker bundle exec rake jobs:work RAILS_ENV=production