The "magical" whale.
- Remove existing image, if needed. See "Misc commands" for details.
- Build the new image
docker build -t app .
- Find the image ID
docker images docker run -t -d --name my_app
| // Set request blocking before any network activity | |
| // No "clearing" is done at the end of the pass since blockUrlPatterns([]) will unset all if | |
| // neccessary at the beginning of the next pass. | |
| await passContext.driver.blockUrlPatterns(blockedUrls); | |
| await passContext.driver.setExtraHTTPHeaders(passContext.settings.extraHeaders); | |
| // Add this call for setting the cookie. | |
| await passContext.driver.setCookie(); |
| # TODO: document these. | |
| docker rm -v $(docker ps --filter status=exited -q 2>/dev/null) 2>/dev/null | |
| docker rmi $(docker images --filter dangling=true -q 2>/dev/null) 2>/dev/null |
| #!/bin/bash | |
| terminus backup:create site.env --element db &>/dev/null & | |
| disown |
| #!/bin/bash | |
| docker system prune -f | |
| docker image prune -f | |
| docker volume prune -f |
| certbot certonly --manual --preferred-challenges dns -d '*.domain.com' -d domain.com | |
| # Will have to add 2 DNS records in separate steps. | |
| # Verify records are there. | |
| nslookup -q=txt _acme-challenge.domain.com | |
| dig -t txt _acme-challenge.domain.com +short | |
| # Place files, if needed. | |
| # Restart webserver. |
| certbot certonly --manual --preferred-challenges dns --manual-public-ip-logging-ok -d '*.domain.com' -d domain.com | |
| # update TXT records for authentication | |
| sudo service apache2 reload |
| certbot certonly --manual --preferred-challenges dns --manual-public-ip-logging-ok -d '*.domain.com' -d domain.com | |
| # update TXT records for authentication | |
| sudo service apache2 reload |
| # https://pantheon.io/docs/rsync-and-sftp/ | |
| # $ENV is dev/test/live or multidev | |
| # $SITE is UUID | |
| # Ran from the 'sites/default' directory (or applicable site directory). | |
| rsync -rvlz \ | |
| --copy-unsafe-links \ | |
| --size-only \ | |
| --ipv4 \ |
| #!/usr/bin/bash | |
| sudo mkdir -p /opt/box | |
| cd /opt/box | |
| sudo curl -OL https://github.com/humbug/box/releases/download/3.4.0/box.phar | |
| sudo chmod +x box.phar | |
| sudo mv box.phar box-3.4.0.phar | |
| sudo update-alternatives --install /usr/bin/box box /opt/box/box-3.4.0.phar 10 | |