Skip to content

Commit

Permalink
Merge pull request #8 from lpicanco/main
Browse files Browse the repository at this point in the history
add lpicanco
  • Loading branch information
zanfranceschi authored Feb 5, 2024
2 parents 9e95e7d + f6cf74f commit 3f42bde
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 0 deletions.
13 changes: 13 additions & 0 deletions participantes/lpicanco/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Rinha de Backend 2024-Q1

### Luiz Picanço

Github: [@lpicanco](https://github.com/lpicanco)
Twitter: [@lpicanco](https://twitter.com/lpicanco)
Repositório: [https://github.com/lpicanco/backend-dogfight-rust-24-q1](https://github.com/lpicanco/backend-dogfight-rust-24-q1)


### Stack: Rust com Postgres
- Rust 🦀
- Postgres
- Nginx
55 changes: 55 additions & 0 deletions participantes/lpicanco/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
version: "3.5"

services:
api01: &api
image: ghcr.io/lpicanco/backend-dogfight-rust-24-q1:latest
hostname: api01
expose:
- "9999"
restart: unless-stopped
depends_on:
- db
deploy:
resources:
limits:
cpus: '0.15'
memory: "100MB"

api02:
<<: *api
hostname: api02
ports:
- "3002:3000"

nginx:
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
restart: unless-stopped
depends_on:
- api01
- api02
ports:
- "9999:9999"
deploy:
resources:
limits:
cpus: "0.20"
memory: "50MB"

db:
image: postgres:latest
hostname: db
restart: unless-stopped
environment:
POSTGRES_DB: dogfight
POSTGRES_USER: dogfight_user
POSTGRES_PASSWORD: dogfight_pass
volumes:
- ./schema.sql:/docker-entrypoint-initdb.d/init.sql
command: postgres -c checkpoint_timeout=600 -c max_wal_size=4096
deploy:
resources:
limits:
cpus: '1'
memory: "300MB"
19 changes: 19 additions & 0 deletions participantes/lpicanco/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
events {
worker_connections 2000;
}
http {
upstream api {
server api01:9999;
server api02:9999;
}
server {
listen 9999;
location / {
proxy_pass http://api;
}
access_log off;
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_send_timeout 300;
}
}
1 change: 1 addition & 0 deletions participantes/lpicanco/schema.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
\c dogfight

0 comments on commit 3f42bde

Please sign in to comment.