volumes: pg_db_data: {} services: api1: image: brunojppb/rinha-backend-elixir:latest # build: . environment: DATABASE_URL: "postgres://rinha:rinha@pg_db/rinha" SECRET_KEY_BASE: "Uqvf3M+IXeljed/6G07bXATy/teOrUpUZUhkKx8UEdLG5/INoUcj4VGJCBDTXBNP" PHX_HOST: "api1" PORT: "80" depends_on: pg_db: condition: service_healthy healthcheck: test: curl -f http://api1:80 ports: - "3333:80" expose: - "80" deploy: resources: limits: cpus: "0.25" memory: "0.5GB" api2: image: brunojppb/rinha-backend-elixir:latest # build: . environment: DATABASE_URL: "postgres://rinha:rinha@pg_db/rinha" SECRET_KEY_BASE: "Uqvf3M+IXeljed/6G07bXATy/teOrUpUZUhkKx8UEdLG5/INoUcj4VGJCBDTXBNP" PHX_HOST: "api2" PORT: "80" depends_on: pg_db: condition: service_healthy ports: - "4444:80" healthcheck: test: curl -f http://api2:80 expose: - "80" deploy: resources: limits: cpus: "0.25" memory: "0.5GB" pg_db: image: postgres:15 healthcheck: test: ["CMD-SHELL", "pg_isready -U rinha"] interval: 2s timeout: 1s retries: 5 environment: - POSTGRES_USER=rinha - POSTGRES_PASSWORD=rinha - POSTGRES_DB=rinha ports: - "5432:5432" volumes: - pg_db_data:/var/lib/postgresql/data deploy: resources: limits: cpus: "0.85" memory: "1.5GB" nginx: image: nginx:latest volumes: - ./nginx.conf:/etc/nginx/nginx.conf:ro depends_on: api1: condition: service_healthy api2: condition: service_healthy ports: - "9999:9999" deploy: resources: limits: cpus: "0.15" memory: "0.5GB"