Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adiciona o pREST como uma possibilidade de API ao serviço #168

Merged
merged 13 commits into from
Dec 19, 2022
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions api/config/prest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[access]
restrict = true

[[access.tables]]
name = "cnpj"
permissions = ["read"]

[[access.tables]]
name = "meta"
permissions = ["write"]
vmesel marked this conversation as resolved.
Show resolved Hide resolved
28 changes: 28 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ services:
- .env
volumes:
- ./data:/mnt/data
depends_on:
postgres:
condition: service_healthy
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eu não incluiria isso, como justificado em outro PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cuducos se o banco não tiver subido antes do pREST, ele falha na conexão. Como que a gente faz sem condition?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Se o banco tem que subir antes do serviço prest esse bloco tem que estar no serviço prest e não no serviço minha-receita (e ele já está, linhas 43-45).


postgres:
image: postgres:14-alpine
Expand All @@ -32,3 +35,28 @@ services:
- 5555:5432
environment: *credentials
command: ["postgres", "-c", "log_statement=all"]

prest:
image: prest/prest:latest
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Não seria melhor (no sentido de previsibilidade e reprodutibilidade) especificar uma versão?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seria!

ports:
- 8081:8081
depends_on:
postgres:
condition: service_healthy

environment:
- PREST_DEBUG=true
vmesel marked this conversation as resolved.
Show resolved Hide resolved
- PREST_AUTH_ENABLED=false
vmesel marked this conversation as resolved.
Show resolved Hide resolved
- PREST_PG_HOST=postgres
- PREST_PG_USER=minhareceita
- PREST_PG_PASS=minhareceita
- PREST_PG_DATABASE=minhareceita
- PREST_PG_PORT=5432
- PREST_SSL_MODE=disable
- PREST_CACHE_ENABLED=false
- PREST_CACHE=false
vmesel marked this conversation as resolved.
Show resolved Hide resolved
- PREST_HTTP_PORT=8081
- PREST_QUERIES_LOCATION=/prest/data/queries/
- PREST_CONF=/prest/data/config/prest.toml
volumes:
- ./api/:/prest/data/