forked from zanfranceschi/rinha-de-backend-2024-q1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
86 lines (62 loc) · 1.49 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
version: "3.9"
services:
nginx:
image: nginx:1.25.3-alpine3.18
restart: unless-stopped
hostname: nginx
# network_mode: "host"
depends_on:
- api1
- api2
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
ports:
- "9999:9999"
deploy:
resources:
limits:
cpus: "0.18"
memory: "100MB"
api1: &api
image: ghcr.io/leoggo/rinha_go:latest
restart: unless-stopped
hostname: api1
# network_mode: "host"
depends_on:
- postgres
# build: ./Dockerfile
environment:
- DEFAULT_SHUTDOWN_TIME_OUT=100
- DEFAULT_READ_TIME_OUT=1200
- DEFAULT_WRITE_TIME_OUT=1200
- DEFAULT_IDLE_TIME_OUT=1200
- DEFAULT_READ_HEADER_TIME_OUT=1200
- DEFAULT_MAX_BD_CONNECTIONS=25
deploy:
resources:
limits:
cpus: "0.175"
memory: "80MB"
api2:
<<: *api
hostname: api2
postgres:
image: postgres:16.1-alpine3.19
restart: unless-stopped
hostname: postgres
# network_mode: "host"
environment:
- POSTGRES_PASSWORD=senha
- POSTGRES_USER=user
- POSTGRES_DB=clientes
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql:ro
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
deploy:
resources:
limits:
cpus: "0.97"
memory: "290MB"