-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathdocker-compose.yml
67 lines (63 loc) · 1.65 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
version: '3'
services:
rinha_api1: &rinha_api1
image: nathanbahiadev/rinha_backend_2024_q1_golang:latest
container_name: rinha_api1
network_mode: host
restart: unless-stopped
environment:
PORT: ":3001"
DATABASE_URL: "postgres://myuser:mypassword@localhost:5432/mydatabase?sslmode=disable"
depends_on:
postgres:
condition: service_healthy
deploy:
resources:
limits:
cpus: "0.3"
memory: "100MB"
rinha_api2:
<<: *rinha_api1
container_name: rinha_api2
environment:
PORT: ":3002"
DATABASE_URL: "postgres://myuser:mypassword@localhost:5432/mydatabase?sslmode=disable"
postgres:
image: postgres:latest
container_name: rinha_postgres
command: postgres -c config_file=/docker-entrypoint-initdb.d/postgresql.conf
restart: unless-stopped
network_mode: host
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 5s
timeout: 5s
retries: 20
start_period: 10s
environment:
POSTGRES_DB: mydatabase
POSTGRES_USER: myuser
POSTGRES_PASSWORD: mypassword
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
- ./postgresql.conf:/docker-entrypoint-initdb.d/postgresql.conf
deploy:
resources:
limits:
cpus: '0.6'
memory: '225MB'
nginx:
image: nginx:latest
container_name: rinha_nginx
network_mode: host
restart: unless-stopped
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
depends_on:
- rinha_api1
- rinha_api2
deploy:
resources:
limits:
cpus: "0.3"
memory: "125MB"