Skip to content

drewpayment/choice-marketing-partners

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Choice Marketing Partners

Notes

Need to fix SSL and HTTPS

Let's Encrypt Tutorial

Nginx HTTPS

Docker/Sail

How to backup/restore the DB for development

# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql

# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE

Deploy the site with Docker

  1. SSH into production server
  2. Run the follow commands:
> ssh [email protected]
! Thanks for logging in!! 
> cd www/choice-marketing-partners.com
> git pull
> docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d --build
  1. You may have to clear the cache, because Laravel hates you and weird things may happen otherwise:
> php artisan optimize:clear

Docker in Development

So, I stopped using Laravel Sail because it's dumb that it doesn't have a production release option at all and causes insane amounts of confusion for releasing code. Instead, I made a custom Dockerfile and use Docker Compose. I merge the compose files and use compose in production as well. The command to run both are very similar, but Docker Compose doesn't have the latest version released for Linux yet so the command is a bit different:

> docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d --build

MySql Backup/Restore

  1. SSH into production server and create backup:
(on local cli)
> ssh [email protected]

(on ssh terminal)
> mysqldump --protocol=tcp --no-create-info --column-statistics=0 -u root -p <database_name> > ./<backupname>_<data>.sql
> (logout)

(on local cli)
> scp [email protected]:<backupname>_<data>.sql ~/folder/backup_filename.sql
  1. Import into your development SQL database with GUI tool or mysqldump import