Skip to content

Commit

Permalink
add prisma-bun (zanfranceschi#1627)
Browse files Browse the repository at this point in the history
  • Loading branch information
Schrammel authored Mar 11, 2024
1 parent 331bc6c commit eca1355
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 0 deletions.
14 changes: 14 additions & 0 deletions participantes/schrammel-bun-prisma/README.md
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)


59 changes: 59 additions & 0 deletions participantes/schrammel-bun-prisma/docker-compose.yml
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"

22 changes: 22 additions & 0 deletions participantes/schrammel-bun-prisma/nginx.conf
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;
}
}
}

0 comments on commit eca1355

Please sign in to comment.