pg_dump -h <host> -p <port> -U <user> <db_name> > <filename>.sql
The
portis not required in case it's the default
Example:
| ServerRoot "/home/edwinmore1/webapps/merco2/apache2" | |
| LoadModule authz_core_module modules/mod_authz_core.so | |
| LoadModule dir_module modules/mod_dir.so | |
| LoadModule env_module modules/mod_env.so | |
| LoadModule log_config_module modules/mod_log_config.so | |
| LoadModule mime_module modules/mod_mime.so | |
| LoadModule rewrite_module modules/mod_rewrite.so | |
| LoadModule setenvif_module modules/mod_setenvif.so | |
| LoadModule wsgi_module modules/mod_wsgi.so |
| RewriteEngine On | |
| RewriteCond %{SERVER_PORT} !^443$ | |
| RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L] |
| # INFO: REPLACE EVERYTHING INSIDE <> | |
| # Start docker server in centos | |
| sudo systemctl start docker | |
| # Build and tag image | |
| docker build -t <username>/<project_name>:<tag> <project_path> | |
| # Create docker secret | |
| echo "<secret>" | docker secret create <secret_name> - |
| # Dumpdata indented | |
| python manage.py dumpdata <app> --indent=2 > <filename>.json | |
| # Dumpdata with natural keys (No numeric) and indented | |
| python manage.py dumpdata <app> --natural-foreign --natural-primary --indent=2 > <filename>.json |
Database access optimization:
Make password hash:
After installing with curl | bash, or another way you should go to the server ip or domain name.
Dokku allows users to push with the ssh public key, in Mac it's usually a file located here "~/.ssh/id_rsa.pub"
To manage dokku ssh-keys run inside the dokku machine:
dokku ssh-keys
| 1. Install the aws cli with pip3: | |
| https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html | |
| 2. Set up Amazon Elastic Container Registry (ECR) | |
| https://docs.aws.amazon.com/AmazonECR/latest/userguide/ECR_GetStarted.html | |
| > This is a service like docker hub to push docker images, after configuring it we can push images to Amazon | |
| Tip: To use the docker login automatically type in the console: | |
| $(aws ecr get-login --no-include-email) |