-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
99 lines (98 loc) · 2.63 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
87
88
89
90
91
92
93
94
95
96
97
98
99
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
version: '3'
services:
app:
build:
context: ./apps
environment:
SPANNER_EMULATOR_HOST: spanner:9010
GOOGLE_CLOUD_PROJECT: ${GOOGLE_CLOUD_PROJECT}
INSTANCE_NAME: ${INSTANCE_NAME}
DATABASE_NAME: ${DATABASE_NAME}
ENV: docker
LOG_LEVEL: DEBUG
ports:
- "8000:8000"
restart: always
depends_on:
- spanner
spanner:
image: gcr.io/cloud-spanner-emulator/emulator:1.4.2
ports:
- "9010:9010"
- "9020:9020"
restart: always
spanner-cli:
image: sjdaws/spanner-cli:latest
environment:
SPANNER_EMULATOR_HOST: spanner:9010
command:
[
'sh',
'-c',
'echo this container keep running && tail -f /dev/null'
]
locust:
build:
context: ./locust
command: /usr/local/bin/locust --headless --timescale --grafana-url=http://grafana:3000 --pghost=postgres --pguser=postgres --pgpassword=password
environment:
LOCUST_LOCUSTFILE: /user/src/app/locustfile.py
LOCUST_HOST: ${TARGET-http://app:8000}
LOCUST_USERS: ${USERS-10}
LOCUST_RUN_TIME: ${LOCUST_RUN_TIME-5m}
LOCUST_LOGLEVEL: ${LOCUST_LOGLEVEL-DEBUG}
REDIS_HOST: redis
depends_on:
- redis
- postgres
- grafana
redis:
image: "redis:6.2.7"
ports:
- "6379:6379"
restart: always
postgres:
image: cyberw/locust-timescale:4
expose:
- 5432
ports:
- 5432:5432
environment:
- POSTGRES_PASSWORD=password
- TIMESCALEDB_TELEMETRY=off
- TS_TUNE_MAX_CONNS=300
- TS_TUNE_MAX_BG_WORKERS=32
volumes:
- postgres_data:/var/lib/postgresql/data
restart: always
grafana:
image: cyberw/locust-grafana:2
environment:
- GF_AUTH_DISABLE_LOGIN_FORM=true
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_SECURITY_ALLOW_EMBEDDING=true
- GF_LOG_LEVEL=warn
ports:
- 3000:3000
volumes:
- grafana_data:/var/lib/grafana
restart: always
depends_on:
- postgres
volumes:
postgres_data: null
grafana_data: null