-
Notifications
You must be signed in to change notification settings - Fork 925
/
docker-compose.yml
68 lines (67 loc) · 1.55 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
version: "3.9"
services:
db:
image: postgres:16-alpine
command: postgres -c config_file=/etc/postgresql/postgresql.conf
restart: unless-stopped
ports:
- 5432:5432
volumes:
- .docker/config/postgresql.conf:/etc/postgresql/postgresql.conf
environment:
- POSTGRES_PASSWORD=RinhaMaster123
- POSTGRES_USER=rinha
- POSTGRES_DB=default_db
healthcheck:
test: ["CMD-SHELL", "pg_isready -U rinha -d default_db"]
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
cpus: "0.55"
memory: "250MB"
service-01: &service
image: richhh7g/rinha-2024:latest
restart: unless-stopped
environment:
- APP_PORT=3000
- NODE_ENV=production
- DATABASE_URL=postgres://rinha:RinhaMaster123@db:5432/default_db
expose:
- "3000:3000"
hostname: service-01
depends_on:
db:
condition: service_healthy
deploy:
restart_policy:
condition: on-failure
delay: 10s
resources:
limits:
cpus: "0.35"
memory: "112MB"
service-02:
<<: *service
hostname: service-02
load-balancer:
image: haproxy:alpine
restart: unless-stopped
hostname: load-balancer
ports:
- "9999:9999"
volumes:
- .docker/config/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
depends_on:
- service-01
- service-02
deploy:
resources:
limits:
cpus: "0.25"
memory: "75MB"
networks:
default:
driver: bridge