-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathcompose.yaml
67 lines (62 loc) · 1.5 KB
/
compose.yaml
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
version: '3.5'
services:
api01: &app
image: hiroshimorowaka/rinha-backend-2024:golang
# build: .
hostname: api01
network_mode: host
container_name: api01-golang
environment:
- DATABASE_URL=postgres://docker:docker@localhost:5432/rinha?sslmode=disable
- HTTP_PORT=8081
depends_on:
postgres:
condition: service_healthy
deploy:
resources:
limits:
cpus: '0.2'
memory: '50MB'
api02:
<<: *app
hostname: api02
container_name: api02-golang
environment:
- DATABASE_URL=postgres://docker:docker@localhost:5432/rinha?sslmode=disable
- HTTP_PORT=8082
postgres:
image: postgres:16.1-alpine3.19
network_mode: host
container_name: postgres
command: postgres -c 'max_connections=75' -c 'log_error_verbosity=terse'
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 5s
timeout: 5s
retries: 20
start_period: 10s
environment:
- POSTGRES_USER=docker
- POSTGRES_PASSWORD=docker
- POSTGRES_DB=rinha
deploy:
resources:
limits:
cpus: '0.6'
memory: '350MB'
nginx:
image: nginx:1.25.3-alpine
network_mode: host
container_name: nginx
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api01
- api02
deploy:
resources:
limits:
cpus: '0.5'
memory: '100MB'