-
Notifications
You must be signed in to change notification settings - Fork 926
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from doceazedo/clean
Adicionar participante doceazedo
- Loading branch information
Showing
4 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<h1 align="center">Rinha de Backend - 2024/Q1</h1> | ||
<p align="center">✨🧡 — <i><b>SvelteKit Edition</b></i> — 🧡✨</p> | ||
|
||
> [!NOTE] | ||
> **O repositório com o código-fonte está disponível [aqui](https://github.com/doceazedo/rinha-de-backend-2024-q1/tree/main/participantes/doceazedo).** | ||
Você já pensou o que aconteceria se um dev frontend participasse de uma rinha de backend? | ||
|
||
Ele mete uma stack dessas: | ||
|
||
- 🧡 [**SvelteKit**](https://kit.svelte.dev): Framework para aplicações Svelte (tal qual o Next é para o React) que, por acaso, serve muito bem pra fazer APIs (em teoria). | ||
- 💚 [**Drizzle**](https://orm.drizzle.team): ORM para TypeScript | ||
- 💙 [**Zod**](https://zod.dev): Validação de dados com TypeScript | ||
- 🐘 [**PostgreSQL**](https://orm.drizzle.team/docs/get-started-postgresql): Banco de dados relacional | ||
|
||
E isso aqui acontece: | ||
|
||
![](https://i.imgur.com/XffIUTj.png) | ||
|
||
_100% de taxa de sucesso e uma média de 5ms de tempo de resposta!_ ✨ | ||
|
||
## Instruções | ||
|
||
Nenhuma configuração adicional é necessária, apenas use o comando... | ||
|
||
```sh | ||
$ docker-compose up | ||
``` | ||
|
||
...e voilà! 🪄 | ||
|
||
## Autor | ||
|
||
- Doce — Twitter: [@doceazedo911](https://twitter.com/doceazedo911) ✦ Site: [doceazedo.com](https://doceazedo.com) | ||
|
||
[![](https://discord-invite.doceazedo.com/vEGRe2kq8B.svg)](https://discord.gg/vEGRe2kq8B) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
services: | ||
nginx: | ||
image: nginx:latest | ||
volumes: | ||
- ./nginx.conf:/etc/nginx/nginx.conf:ro | ||
depends_on: | ||
- api01 | ||
- api02 | ||
ports: | ||
- "9999:9999" | ||
deploy: | ||
resources: | ||
limits: | ||
cpus: "0.1" | ||
memory: "50MB" | ||
|
||
postgres: | ||
image: postgres:16.1-alpine | ||
environment: | ||
POSTGRES_USER: "postgres" | ||
POSTGRES_PASSWORD: "123456" | ||
POSTGRES_DB: "postgres" | ||
volumes: | ||
- postgres:/var/lib/postgresql/data | ||
- ./postgresql.conf:/etc/postgresql.conf | ||
deploy: | ||
resources: | ||
limits: | ||
cpus: "0.6" | ||
memory: "200MB" | ||
|
||
api01: &api01 | ||
image: doceazedo/rinha-de-backend-2024-q1:latest | ||
environment: | ||
DB_HOST: "postgres" | ||
DB_PORT: "5432" | ||
DB_USER: "postgres" | ||
DB_PASSWORD: "123456" | ||
DB_DATABASE: "postgres" | ||
depends_on: | ||
- postgres | ||
restart: always | ||
deploy: | ||
resources: | ||
limits: | ||
cpus: "0.4" | ||
memory: "150MB" | ||
|
||
api02: | ||
<<: *api01 | ||
|
||
volumes: | ||
postgres: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
worker_processes auto; | ||
|
||
events { | ||
worker_connections 256; | ||
} | ||
|
||
http { | ||
upstream api { | ||
server api01:3000; | ||
server api02:3000; | ||
} | ||
|
||
server { | ||
listen 9999; | ||
|
||
location / { | ||
proxy_pass http://api; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
shared_buffers = 256MB | ||
effective_cache_size = 1GB |