Como criar algo funcional com o que aprendemos







Last updated







Last updated
/tmp$ git clone https://github.com/marcelobarbieri/devops-kube-news.git
Cloning into 'devops-kube-news'...
remote: Enumerating objects: 67, done.
remote: Total 67 (delta 0), reused 0 (delta 0), pack-reused 67 (from 1)
Receiving objects: 100% (67/67), 1.92 MiB | 1.67 MiB/s, done.
Resolving deltas: 100% (10/10), done.
/tmp$ cd devops-kube-news/
/tmp/devops-kube-news$ ls
README.md popula-dados.http src$ node --version
v12.22.9$ docker container run -d -p 5432:5432 \
-e POSTGRES_PASSWORD=pg123 \
-e POSTGRES_USER=kubenews \
-e POSTGRES_DB=kubenew \
-v kubenews_vol:/var/lib/postgresql/data \
postgres:13.16
Unable to find image 'postgres:13.16' locally
13.16: Pulling from library/postgres
e4fff0779e6d: Pull complete
6cf30cfc822c: Pull complete
af1d574c3ad1: Pull complete
9770b3362dda: Pull complete
dda3697c5b16: Pull complete
f198a7595590: Pull complete
eb4191d05878: Pull complete
1d0eb8a8dbad: Pull complete
66f0b6ddcec2: Pull complete
66c9ebb47429: Pull complete
eea6f96f604b: Pull complete
b7c08779da16: Pull complete
32dc030c5211: Pull complete
32ceea7ae699: Pull complete
Digest: sha256:0b66ab08973087a4592632a719e6b83357bf63a5db4f92ae507cbe0037cbdd85
Status: Downloaded newer image for postgres:13.16
074db4d0133837bdb6d308b10a65532931b48acded939e7ee02e15fc912a6419$ docker volume ls
DRIVER VOLUME NAME
local kubenews_vol/tmp/devops-kube-news/src$ npm install
added 116 packages, and audited 117 packages in 10s
10 packages are looking for funding
run `npm fund` for details
2 moderate severity vulnerabilities
To address all issues, run:
npm audit fix
Run `npm audit` for details.
npm notice
npm notice New minor version of npm available! 10.7.0 -> 10.8.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.2
npm notice To update run: npm install -g npm@10.8.2
npm notice/tmp/devops-kube-news/src$ DB_DATABASE=kubenew DB_USERNAME=kubenews DB_PASSWORD=pg123 node server.js
Aplicação rodando na porta 8080
Executing (default): SELECT table_name FROM information_schema.tables WHERE table_schema = 'public' AND table_name = 'Posts'
Executing (default): CREATE TABLE IF NOT EXISTS "Posts" ("id" SERIAL , "title" VARCHAR(255), "summary" VARCHAR(255), "publishDate" DATE, "content" VARCHAR(2000), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, PRIMARY KEY ("id"));
Executing (default): SELECT i.relname AS name, ix.indisprimary AS primary, ix.indisunique AS unique, ix.indkey AS indkey, array_agg(a.attnum) as column_indexes, array_agg(a.attname) AS column_names, pg_get_indexdef(ix.indexrelid) AS definition FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND t.relkind = 'r' and t.relname = 'Posts' GROUP BY i.relname, ix.indexrelid, ix.indisprimary, ix.indisunique, ix.indkey ORDER BY i.relname;