Skip to content

Commit

Permalink
Merge pull request #224 from guimeira/guimeira
Browse files Browse the repository at this point in the history
Guilherme Meira (guimeira): Java + Quarkus + Postgres
  • Loading branch information
zanfranceschi authored Aug 23, 2023
2 parents effa5fe + cad4028 commit 1f398fa
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
5 changes: 5 additions & 0 deletions participantes/guimeira/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Rinha de Backend 2023

- **Autor:** Guilherme Meira ([guimeira](https://github.com/guimeira))

- **Repositório:** https://github.com/guimeira/rinha-backend-2023
63 changes: 63 additions & 0 deletions participantes/guimeira/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
version: '3.5'
services:
api1: # API - Instância 01
image: gtmeira/rinha-backend-2023:1.0.0
hostname: api1
depends_on:
db:
condition: service_healthy
expose:
- "8080"
deploy:
resources:
limits:
cpus: '0.2'
memory: '0.15GB'

api2: # API - Instância 01
image: gtmeira/rinha-backend-2023:1.0.0
hostname: api2
depends_on:
db:
condition: service_healthy
expose:
- "8080"
deploy:
resources:
limits:
cpus: '0.2'
memory: '0.15GB'

nginx: # Load Balancer
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api1
- api2
ports:
- "9999:9999"
deploy:
resources:
limits:
cpus: '0.2'
memory: '0.1GB'

db: # Banco de dados
image: postgres
command: -c fsync=off -c synchronous_commit=off
environment:
POSTGRES_USER: rinha
POSTGRES_PASSWORD: rinha1234
ports:
- "5432:5432"
deploy:
resources:
limits:
cpus: '0.9'
memory: '2.6GB'
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U rinha" ]
interval: 5s
timeout: 5s
retries: 5
17 changes: 17 additions & 0 deletions participantes/guimeira/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
events {
worker_connections 10000;
}
http {
upstream api {
server api1:8080;
server api2:8080;
}

server {
listen 9999;
location / {
proxy_pass http://api;
access_log off;
}
}
}

0 comments on commit 1f398fa

Please sign in to comment.