forked from zanfranceschi/rinha-de-backend-2024-q1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
57 lines (53 loc) · 1.27 KB
/
docker-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
version: "3.8"
services:
api-east: &api
image: ghcr.io/rycastr/crebito-rs:main
environment:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/crebito
DATABASE_POOL_SIZE: 1
APP_PORT: 4000
network_mode: host
depends_on:
- db
deploy:
resources:
limits:
cpus: '0.35'
memory: '165MB'
api-west:
<<: *api
environment:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/crebito
DATABASE_POOL_SIZE: 1
APP_PORT: 4001
nginx:
image: nginx:alpine3.18
restart: on-failure
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api-east
- api-west
network_mode: host
deploy:
resources:
limits:
cpus: '0.2'
memory: '20MB'
db:
image: postgres:16-alpine3.18
hostname: db
command: postgres -c config_file=/etc/postgresql.conf
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=postgres
- POSTGRES_DB=crebito
volumes:
- ./postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
- ./postgres/postgres.conf:/etc/postgresql.conf
network_mode: host
deploy:
resources:
limits:
cpus: '0.6'
memory: '200MB'