-
Notifications
You must be signed in to change notification settings - Fork 60
/
docker-compose.yml
133 lines (126 loc) · 4.01 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
services:
rbac-server:
container_name: rbac_server
build:
context: .
dockerfile: Dockerfile
working_dir: /rbac
entrypoint:
- ./scripts/entrypoint.sh
environment:
- DATABASE_SERVICE_NAME=POSTGRES_SQL
- DATABASE_ENGINE=postgresql
- DATABASE_NAME=postgres
- POSTGRES_SQL_SERVICE_HOST=db
- POSTGRES_SQL_SERVICE_PORT=5432
- DATABASE_HOST=db
- DATABASE_PORT=5432
- API_PATH_PREFIX=/api/rbac
- DATABASE_USER=postgres
- DATABASE_PASSWORD=postgres
- DJANGO_LOG_HANDLERS=console,ecs
- DJANGO_READ_DOT_ENV_FILE=True
- DEVELOPMENT=${DEVELOPMENT-False}
- DJANGO_DEBUG=${DJANGO_DEBUG-True}
- REDIS_HOST=${REDIS_HOST-rbac_redis}
- PRINCIPAL_PROXY_SERVICE_PROTOCOL=${PRINCIPAL_PROXY_SERVICE_PROTOCOL-https}
- PRINCIPAL_PROXY_SERVICE_PORT=${PRINCIPAL_PROXY_SERVICE_PORT-443}
- PRINCIPAL_PROXY_SERVICE_HOST=${PRINCIPAL_PROXY_SERVICE_HOST}
- PRINCIPAL_PROXY_USER_ENV=${PRINCIPAL_PROXY_USER_ENV-stage}
- PRINCIPAL_PROXY_CLIENT_ID=${PRINCIPAL_PROXY_CLIENT_ID-insights-rbac}
- PRINCIPAL_PROXY_API_TOKEN=${PRINCIPAL_PROXY_API_TOKEN}
- BYPASS_BOP_VERIFICATION=${BYPASS_BOP_VERIFICATION-True}
- PRINCIPAL_PROXY_SERVICE_PATH=${PRINCIPAL_PROXY_SERVICE_PATH}
- PRINCIPAL_PROXY_SERVICE_SOURCE_CERT=${PRINCIPAL_PROXY_SERVICE_SOURCE_CERT-False}
- PRINCIPAL_PROXY_SERVICE_SSL_VERIFY=${PRINCIPAL_PROXY_SERVICE_SSL_VERIFY-False}
- RBAC_DESTRUCTIVE_API_ENABLED_UNTIL=${RBAC_DESTRUCTIVE_API_ENABLED_UNTIL}
- RBAC_DESTRUCTIVE_SEEDING_ENABLED_UNTIL=${RBAC_DESTRUCTIVE_SEEDING_ENABLED_UNTIL}
privileged: true
ports:
- 9080:8080
volumes:
- '.:/rbac/'
depends_on:
db:
condition: service_healthy
rbac-worker:
condition: service_healthy
rbac-scheduler:
condition: service_healthy
healthcheck:
test: curl -q http://localhost:8080/metrics
interval: 5s
timeout: 5s
retries: 10
rbac-worker:
container_name: rbac_worker
build:
context: .
dockerfile: Dockerfile
working_dir: /opt/rbac/rbac
entrypoint: ['celery', '--broker=redis://redis:6379/0', '-A', 'rbac.celery', 'worker', '--loglevel=INFO']
privileged: true
depends_on:
redis:
condition: service_healthy
healthcheck:
test: [ "CMD-SHELL", "celery --broker=redis://redis:6379/0 -A rbac.celery status" ]
interval: 30s
timeout: 10s
retries: 3
rbac-scheduler:
container_name: rbac_scheduler
build:
context: .
dockerfile: Dockerfile
working_dir: /opt/rbac/rbac
entrypoint: ['celery', '--broker=redis://redis:6379/0', '-A', 'rbac.celery', 'beat', '--loglevel=INFO']
privileged: true
depends_on:
redis:
condition: service_healthy
healthcheck:
test: [ "CMD-SHELL", "celery --broker=redis://redis:6379/0 -A rbac.celery status" ]
interval: 30s
timeout: 10s
retries: 3
redis:
container_name: rbac_redis
image: redis:5.0.4
ports:
- "6379:6379"
healthcheck:
test: [ "CMD-SHELL", "redis-cli ping | grep PONG" ]
interval: 1s
timeout: 3s
retries: 5
db:
container_name: rbac_db
image: postgres:14.5
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- PGDATA=/var/lib/postgresql/data/pgdata
ports:
- "15432:5432"
volumes:
- pg_data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 5s
retries: 3
start_period: 5s
wait_for_app:
container_name: wait_for_app
image: hello-world:latest
depends_on:
rbac-server:
condition: service_healthy
volumes:
pg_data:
networks:
default:
name: rbac-network
external: true