rinha-backend-node-2025/docker-compose.yml
2025-08-17 22:32:13 -04:00

115 lines
2.1 KiB
YAML

services:
api1:
image: jos3duardo/rinha-backend-2025:v1.0
restart: always
networks:
- backend
- payment-processor
depends_on:
- redis
- database
deploy:
resources:
limits:
cpus: "0.3"
memory: "67MB"
api2:
image: jos3duardo/rinha-backend-2025:v1.0
restart: always
depends_on:
- redis
- database
networks:
- backend
- payment-processor
deploy:
resources:
limits:
cpus: "0.3"
memory: "67MB"
api3:
image: jos3duardo/rinha-backend-2025:v1.0
restart: always
depends_on:
- redis
- database
networks:
- backend
- payment-processor
deploy:
resources:
limits:
cpus: "0.3"
memory: "67MB"
nginx:
image: nginx:latest
restart: always
ports:
- "9999:9999"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
networks:
- backend
depends_on:
- api1
- api2
- api3
deploy:
resources:
limits:
cpus: "0.10"
memory: "9MB"
redis:
image: redis:7.2-alpine
restart: always
platform: linux/amd64
ports:
- "6379:6379"
networks:
- backend
deploy:
resources:
limits:
cpus: "0.30"
memory: "15MB"
database:
image: postgres:17-alpine
restart: always
command: postgres -c checkpoint_timeout=600 -c max_wal_size=4096 -c synchronous_commit=0 -c fsync=0 -c full_page_writes=0
platform: linux/amd64
ports:
- "5432:5432"
environment:
- POSTGRES_DB=payment
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres_pwd
volumes:
- ./sql/init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 3s
timeout: 3s
retries: 5
networks:
- backend
deploy:
resources:
limits:
cpus: "0.20"
memory: "125MB"
networks:
backend:
driver: bridge
payment-processor:
external: true
volumes:
db_volume:
redis_data: