-
Notifications
You must be signed in to change notification settings - Fork 932
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 #8 from lpicanco/main
add lpicanco
- Loading branch information
Showing
4 changed files
with
88 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,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 |
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,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" |
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,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; | ||
} | ||
} |
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 @@ | ||
\c dogfight |