1
1
version : " 3"
2
2
3
+ x-env :
4
+ &env
5
+ environment :
6
+ - ENV=debug
7
+ - SECRET_KEY="very_secret"
8
+ - POSTGRES_DB=sentry
9
+ - POSTGRES_USER=sentry
10
+ - POSTGRES_PASSWORD=sentry
11
+ - POSTGRES_HOST=postgres
12
+ - POSTGRES_PORT=5432
13
+ - APP_CACHE_TIMEOUT=600
14
+ - CACHE_REDIS_URL=redis://redis:6379
15
+ - CACHE_TIMEOUT=120
16
+ - DEFAULT_SAMPLE_RATE=0.1
17
+ - DEFAULT_WSGI_IGNORE_PATHS="/health,/healthz,/health/,/healthz/"
18
+ - MAX_BUMP_TIME_SEC=6000
19
+ # oidc
20
+ - OIDC_RP_CLIENT_ID=$OIDC_RP_CLIENT_ID
21
+ - OIDC_RP_CLIENT_SECRET=$OIDC_RP_CLIENT_SECRET
22
+ - OIDC_OP_AUTHORIZATION_ENDPOINT=$OIDC_OP_AUTHORIZATION_ENDPOINT
23
+ - OIDC_OP_TOKEN_ENDPOINT=$OIDC_OP_TOKEN_ENDPOINT
24
+ - OIDC_OP_USER_ENDPOINT=$OIDC_OP_USER_ENDPOINT
25
+ - LOGIN_REDIRECT_URL=$LOGIN_REDIRECT_URL
26
+ - LOGOUT_REDIRECT_URL=$LOGOUT_REDIRECT_URL
27
+ - OIDC_OP_JWKS_ENDPOINT=$OIDC_OP_JWKS_ENDPOINT
28
+ - OIDC_RP_SIGN_ALGO=RS256
29
+ - STATIC_URL=http://localhost:8000/static/
30
+ # rabbit
31
+ - CELERY_BROKER_USER=sentry
32
+ - CELERY_BROKER_PASSWORD=sentry
33
+ - CELERY_BROKER_HOST=rabbitmq
34
+ - CELERY_BROKER_PORT=5672
35
+ # this is for nginx-proxy
36
+ - VIRTUAL_HOST=localhost
37
+ - VIRTUAL_PORT=8000
38
+ - VIRTUAL_PATH=/
39
+
3
40
services :
41
+
42
+ # serves as an ingress to prevent cors errors
43
+ nginx-proxy :
44
+ image : nginxproxy/nginx-proxy
45
+ ports :
46
+ - " 8000:80"
47
+ volumes :
48
+ - /var/run/docker.sock:/tmp/docker.sock:ro
49
+
4
50
postgres :
5
51
image : postgres:latest
6
52
environment :
@@ -9,6 +55,7 @@ services:
9
55
- POSTGRES_PASSWORD=sentry
10
56
profiles :
11
57
- data
58
+ - all
12
59
ports :
13
60
- 5432:5432
14
61
volumes :
@@ -18,53 +65,98 @@ services:
18
65
image : ' bitnami/redis:latest'
19
66
profiles :
20
67
- data
68
+ - all
21
69
environment :
22
70
- ALLOW_EMPTY_PASSWORD=yes
23
71
ports :
24
72
- 6379:6379
25
73
74
+ rabbitmq :
75
+ image : bitnami/rabbitmq:3.11.8
76
+ profiles :
77
+ - data
78
+ - all
79
+ ports :
80
+ - " 15672:15672"
81
+ - " 5672:5672"
82
+ environment :
83
+ - RABBITMQ_DEFAULT_USER=sentry
84
+ - RABBITMQ_DEFAULT_PASS=sentry
85
+ - TZ=Europe/Paris
86
+
87
+ # serve the static files
26
88
static :
27
89
image : spklabs/sentry-dynamic-sampling-controller-static:alpha
28
- ports :
29
- - 8081: 80
90
+ expose :
91
+ - 80
30
92
profiles :
31
93
- app
94
+ - all
95
+ environment :
96
+ # this is for nginx-proxy
97
+ - VIRTUAL_HOST=localhost
98
+ - VIRTUAL_PORT=80
99
+ - VIRTUAL_PATH=/static/
100
+
101
+ # deploy the app
102
+ # the command is optional here
103
+ # but it's customized to migrate the database an load the permissions
32
104
app :
33
105
image : spklabs/sentry-dynamic-sampling-controller:alpha
106
+ command : >
107
+ sh -c "python manage.py migrate && python manage.py loadpermissions && gunicorn controller.wsgi -c /app/config.py"
108
+
34
109
depends_on :
35
110
- postgres
36
111
- redis
37
112
- static
38
- ports :
39
- - 8080:8000
113
+ - rabbitmq
114
+ expose :
115
+ - 8000
40
116
profiles :
41
117
- app
42
- environment :
43
- - ENV=debug
44
- - SECRET_KEY="very_secret"
45
- - POSTGRES_DB=sentry
46
- - POSTGRES_USER=sentry
47
- - POSTGRES_PASSWORD=sentry
48
- - POSTGRES_HOST=postgres
49
- - POSTGRES_PORT=5432
50
- - APP_CACHE_TIMEOUT=600
51
- - CACHE_REDIS_URL=redis://redis:6379
52
- - CACHE_TIMEOUT=120
53
- - DEFAULT_SAMPLE_RATE=0.1
54
- - DEFAULT_WSGI_IGNORE_PATHS="/health,/healthz,/health/,/healthz/"
55
- - MAX_BUMP_TIME_SEC=6000
56
- # oidc
57
- - OIDC_RP_CLIENT_ID=$OIDC_RP_CLIENT_ID
58
- - OIDC_RP_CLIENT_SECRET=$OIDC_RP_CLIENT_SECRET
59
- - OIDC_OP_AUTHORIZATION_ENDPOINT=$OIDC_OP_AUTHORIZATION_ENDPOINT
60
- - OIDC_OP_TOKEN_ENDPOINT=$OIDC_OP_TOKEN_ENDPOINT
61
- - OIDC_OP_USER_ENDPOINT=$OIDC_OP_USER_ENDPOINT
62
- - LOGIN_REDIRECT_URL=$LOGIN_REDIRECT_URL
63
- - LOGOUT_REDIRECT_URL=$LOGOUT_REDIRECT_URL
64
- - OIDC_OP_JWKS_ENDPOINT=$OIDC_OP_JWKS_ENDPOINT
65
- - OIDC_RP_SIGN_ALGO=RS256
66
- - STATIC_URL=http://localhost:8081/static
118
+ - all
119
+ << : *env
120
+
121
+ # Deploy the worker
122
+ worker :
123
+ image : spklabs/sentry-dynamic-sampling-controller:alpha
124
+ command :
125
+ - " celery"
126
+ - " -A"
127
+ - " controller"
128
+ - " worker"
129
+ - " -l"
130
+ - " info"
131
+ depends_on :
132
+ - postgres
133
+ - redis
134
+ - rabbitmq
135
+ profiles :
136
+ - app
137
+ - all
138
+ << : *env
139
+
140
+ # Deploy the beat
141
+ beat :
142
+ image : spklabs/sentry-dynamic-sampling-controller:alpha
143
+ command :
144
+ - " celery"
145
+ - " -A"
146
+ - " controller"
147
+ - " beat"
148
+ - " -l"
149
+ - " info"
150
+ depends_on :
151
+ - postgres
152
+ - redis
153
+ - rabbitmq
154
+ profiles :
155
+ - app
156
+ - all
157
+ << : *env
67
158
159
+ # This optional and it's used to monitor the API
68
160
statsd-exporter :
69
161
image : prom/statsd-exporter:v0.23.0
70
162
ports :
@@ -77,6 +169,7 @@ services:
77
169
command :
78
170
- --statsd.mapping-config=/statsd/statsd.conf
79
171
172
+ # This optional and it's used to monitor the API
80
173
prometheus :
81
174
image : prom/prometheus
82
175
profiles :
@@ -87,6 +180,7 @@ services:
87
180
ports :
88
181
- 9090:9090
89
182
183
+ # This optional and it's used to monitor the API
90
184
grafana :
91
185
image : grafana/grafana
92
186
profiles :
0 commit comments