forked from zanfranceschi/rinha-de-backend-2024-q1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
59 lines (54 loc) · 1.19 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
version: "3.9"
services:
db:
image: postgres:latest
expose:
- "5432:5432"
environment:
- POSTGRES_PASSWORD=password
- POSTGRES_USER=rinha_backend
- POSTGRES_DB=rinha_backend
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
hostname: db
deploy:
resources:
limits:
cpus: '1.0'
memory: '380MB'
service-01: &service
image: public.ecr.aws/v6n3t6k2/rinha-backend-v2:latest
environment:
- APP_PORT=8000
- DATABASE_CONNECTION_STRING=host=db port=5432 dbname=rinha_backend user=rinha_backend password=password
expose:
- "8000:8000"
hostname: service-01
depends_on:
- db
deploy:
resources:
limits:
cpus: '0.2'
memory: '60MB'
service-02:
<<: *service
hostname: service-02
load-balancer:
image: haproxy:alpine
ports:
- "9999:9999"
volumes:
- ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
depends_on:
- service-01
- service-02
hostname: load-balancer
deploy:
resources:
limits:
cpus: '0.1'
memory: '50MB'
networks:
default:
driver: bridge