forked from zanfranceschi/rinha-de-backend-2023-q3
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdocker-compose.yml
75 lines (69 loc) · 1.41 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
version: '3.5'
services:
api1: &api
container_name: rinha-de-backend-app1
image: rinha-de-backend
build:
context: .
args:
APP_STAGE: dev
environment:
DB_HOST: db
REDIS_HOST: cache
volumes:
- ./:/opt/www
depends_on:
- db
- cache
deploy:
resources:
limits:
cpus: '0.25'
memory: '0.7GB'
api2:
<<: *api
container_name: rinha-de-backend-app2
db:
container_name: rinha-de-backend-db
image: mysql:8.1
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
MYSQL_DATABASE: ${DB_DATABASE}
volumes:
- ./migrations.sql:/docker-entrypoint-initdb.d/migrations.sql
ports:
- 3306:3306
deploy:
resources:
limits:
cpus: '0.65'
memory: '1.0GB'
cache:
container_name: rinha-de-backend-cache
image: redis:latest
ports:
- '6379:6379'
deploy:
resources:
limits:
cpus: '0.1'
memory: '0.5GB'
nginx:
image: nginx
container_name: rinha-de-backend-nginx
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- api1
- api2
ports:
- 9999:9999
deploy:
resources:
limits:
cpus: '0.25'
memory: '0.1GB'
networks:
default:
name: rinha-de-backend