docker rm -f $(docker ps -a -q)docker volume rm $(docker volume ls -q)| alias d=docker | |
| alias g=git | |
| alias dk=docker-compose | |
| alias ds='docker stop (docker ps -a -q)' | |
| alias dps='docker ps' | |
| alias dp='docker ps' | |
| alias c='clear' | |
| alias ns='npm start' | |
| alias nt='npm test' | |
| alias nd='npm run dev' |
Followed these steps: CONHEÇA O DOKKU & APRENDA A CONFIGURÁ-LO PASSO-A-PASSO
Crie um droplet na digital ocean usando vps com imagem do dokku
Crie um app no dokku via ssh do seu server
Lembrando que pra configurar o ssl o seu domínio tem que estar apontado para os servers da digital ocean
| const name = 'Sóstenes Apollo'; | |
| const filterText = removeAccents(`%${name}%`).toLowerCase(); | |
| console.log('Filter text', filterText); | |
| this.prisma.$queryRaw`select | |
| id, name | |
| from users | |
| where LOWER(unaccent(name)) LIKE ${filterText};`.then((users) => | |
| console.log(users), | |
| ); |
ref. https://gist.github.com/silverark/2fd88d03fddbe373fce87da80afdc3ce
Line 22:
This connection string should be global, and reusable for all the operations, and not recreated for every method
Line 22:
It’s a really bad code practice to put the connection string inside the code, the common usage is to declare the variables inside a .env file for different environments, but never inside the code itself,
The variables, user, password and dbname should not be public.
| #!/bin/sh | |
| set -o errexit | |
| set -o nounset | |
| IFS=$(printf '\n\t') | |
| # Docker | |
| sudo apt remove --yes docker docker-engine docker.io containerd runc || true | |
| sudo apt update |
| { | |
| "name": "tst", | |
| "version": "1.0.0", | |
| "description": "", | |
| "main": "index.js", | |
| "scripts": { | |
| "prebuild": "rimraf dist", | |
| "build": "tsc", | |
| "start": "node ./dist/index.js", | |
| "dev": "npm run prebuild && tsc-watch --onSuccess \"npm run start\"" |
| name: Deploy | |
| on: | |
| push: | |
| branches: [main] | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| TF_STATE_BUCKET_NAME: ${{ secrets.AWS_TF_STATE_BUCKET_NAME }} | |
| PRIVATE_SSH_KEY: ${{ secrets.AWS_SSH_KEY_PRIVATE }} |