Skip to content

Commit

Permalink
Merge pull request #222 from sinhorinho/main
Browse files Browse the repository at this point in the history
inclusão de participante - @sinhorinho
  • Loading branch information
zanfranceschi authored Aug 23, 2023
2 parents df303ee + c876b65 commit 7639660
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 0 deletions.
100 changes: 100 additions & 0 deletions participantes/sinhorinho/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
version: '3.5'

services:
api1:
image: sinhorinho/rinha-de-backend-2023-q3-elixir:latest
hostname: api1
depends_on:
- db
expose:
- "4000"
environment:
- DATABASE_URL=postgres://postgres:postgres@db/rinha_backend_dev
- SECRET_KEY_BASE=4kZGFFt1SKlRnExAsUKG7aSpJCo2bsyA5smXYNJfe0EbqufOEgTHrzeyzHLITZu0
- PHX_SERVER=true
- 'POOL_SIZE=230'
deploy:
resources:
limits:
cpus: '0.35'
memory: '0.5GB'
networks:
- rinha-backend

api2:
image: sinhorinho/rinha-de-backend-2023-q3-elixir:latest
hostname: api2
depends_on:
- db
expose:
- "4000"
environment:
- DATABASE_URL=postgres://postgres:postgres@db/rinha_backend_dev
- SECRET_KEY_BASE=4kZGFFt1SKlRnExAsUKG7aSpJCo2bsyA5smXYNJfe0EbqufOEgTHrzeyzHLITZu0
- PHX_SERVER=true
- 'POOL_SIZE=230'
deploy:
resources:
limits:
cpus: '0.35'
memory: '0.5GB'
networks:
- rinha-backend

nginx:
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.3GB'
networks:
- rinha-backend

db:
image: postgres:latest
hostname: db
command: '-c synchronous_commit=false -c shared_buffers=256MB -c max_connections=500'
environment:
- 'POSTGRES_DB=rinha_backend_dev'
- 'POSTGRES_USER=postgres'
- 'POSTGRES_PASSWORD=postgres'
- 'LANG=en_US.utf8'
ports:
- "5432:5432"
volumes:
- './priv/repo/migrations/init.sql:/docker-entrypoint-initdb.d/init.sql'
deploy:
resources:
limits:
cpus: '0.7'
memory: '1.3GB'
networks:
- rinha-backend

redis:
image: redis/redis-stack:latest
command: 'redis-server --appendonly no --save "" --protected-mode no'
ports:
- "6379:6379"
deploy:
resources:
limits:
cpus: '0.05'
memory: '0.25GB'
environment:
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_DISABLE_COMMANDS=FLUSHDB,FLUSHALL
networks:
- rinha-backend

networks:
rinha-backend:
driver: bridge
19 changes: 19 additions & 0 deletions participantes/sinhorinho/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
events {
worker_connections 10000;
}
http {
access_log off;

upstream api {
server api1:4000;
server api2:4000;
}

server {
listen 9999;

location / {
proxy_pass http://api;
}
}
}

0 comments on commit 7639660

Please sign in to comment.