-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
69 lines (65 loc) · 1.35 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
version: "3.5"
services:
api-1: &api
image: accerqueira/rinha-de-backend-2024-q1-bash-api
build:
dockerfile: Dockerfile
args:
- SOURCE_PATH=src/api.sh
depends_on:
db:
condition: service_healthy
environment:
- PORT=8081
- WORKERS=8
- CONNECTIONS=1000
- PGHOST=127.0.0.1
- PGUSER=postgres
- PGPASSWORD=postgres
network_mode: host
deploy:
# replicas: 2
resources:
limits:
cpus: "0.5"
memory: "145MB"
api-2:
<<: *api
environment:
- PORT=8082
- WORKERS=8
- CONNECTIONS=1000
- PGHOST=127.0.0.1
- PGUSER=postgres
- PGPASSWORD=postgres
lb:
image: nginx:latest
depends_on:
- api-1
- api-2
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
network_mode: host
deploy:
resources:
limits:
cpus: "0.1"
memory: "10MB"
db:
image: postgres:16-alpine
user: postgres
environment:
- POSTGRES_PASSWORD=postgres
network_mode: host
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 1s
timeout: "5s"
retries: 10
volumes:
- ./migrations/1_setup.sql:/docker-entrypoint-initdb.d/1_setup.sql
deploy:
resources:
limits:
cpus: "0.4"
memory: "250MB"