forked from zanfranceschi/rinha-de-backend-2024-q1
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
95 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,14 @@ | ||
|
||
# Rinha Backend 2ª Edição | ||
* Repositorio do projeto: https://github.com/Schrammel/rinha-backend | ||
|
||
## O que é preciso para subir os apps? | ||
|
||
apenas executar o comando `docker compose up` e é isso, já pode rodar os testes. | ||
|
||
## Tecnologias utilizadas | ||
|
||
- [Bun](https://bun.sh/) | ||
- [Prisma](prisma.io) | ||
|
||
|
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,59 @@ | ||
version: '3' | ||
|
||
services: | ||
postgresdb: | ||
image: postgres | ||
ports: | ||
- 5432:5432 | ||
environment: | ||
POSTGRES_DB: rinha | ||
POSTGRES_USER: rinha | ||
POSTGRES_PASSWORD: rinha | ||
command: postgres -c checkpoint_timeout=600 -c max_wal_size=4096 -c synchronous_commit=0 -c full_page_writes=0 | ||
deploy: | ||
resources: | ||
limits: | ||
cpus: '0.25' | ||
memory: '140MB' | ||
|
||
app1: | ||
image: davidschrammel/prisma_rinha_backend | ||
environment: | ||
DATABASE_URL: "postgresql://rinha:rinha@postgresdb:5432/rinha?connection_limit=13" | ||
entrypoint: "bun prod:migration" | ||
deploy: | ||
replicas: 1 | ||
restart_policy: | ||
condition: on-failure | ||
resources: | ||
limits: | ||
cpus: '0.55' | ||
memory: '150MB' | ||
|
||
app2: | ||
image: davidschrammel/prisma_rinha_backend | ||
entrypoint: "bun prod" | ||
environment: | ||
DATABASE_URL: "postgresql://rinha:rinha@postgresdb:5432/rinha?connection_limit=13" | ||
deploy: | ||
replicas: 1 | ||
restart_policy: | ||
condition: on-failure | ||
resources: | ||
limits: | ||
cpus: '0.55' | ||
memory: '150MB' | ||
|
||
nginx: | ||
image: nginx:latest | ||
volumes: | ||
- ./nginx.conf:/etc/nginx/nginx.conf:ro | ||
restart: on-failure | ||
ports: | ||
- "9999:9999" | ||
deploy: | ||
resources: | ||
limits: | ||
cpus: "0.15" | ||
memory: "50MB" | ||
|
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,22 @@ | ||
worker_processes 1; | ||
|
||
events { | ||
use epoll; | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
access_log off; | ||
upstream api { | ||
server app1:9999; | ||
server app2:9999; | ||
} | ||
|
||
server { | ||
listen 9999; | ||
|
||
location / { | ||
proxy_pass http://api; | ||
} | ||
} | ||
} |