-
Notifications
You must be signed in to change notification settings - Fork 11
/
docker-compose-non-dev.yaml
159 lines (151 loc) · 4.42 KB
/
docker-compose-non-dev.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
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
version: "3.9"
x-swiple-depends-on: &swiple-depends-on
opensearch-node1:
condition: service_healthy
postgres:
condition: service_healthy
x-aws-creds: &aws-creds
AWS_CONFIG_FILE: $HOME/.aws/config
AWS_SHARED_CREDENTIALS_FILE: $HOME/.aws/credentials
services:
swiple_api:
env_file: docker/.env
environment:
<<: *aws-creds
PRODUCTION: true
container_name: swiple_api
image: swiple/swiple-api:main
restart: unless-stopped
ports:
- "8000:8000"
volumes:
- $HOME/.aws:$HOME/.aws
- $HOME/.config/gcloud:/root/.config/gcloud
- $HOME\AppData\Roaming\gcloud:/root/.config/gcloud
depends_on: *swiple-depends-on
scheduler:
env_file: docker/.env
environment:
<<: *aws-creds
APP: SCHEDULER
PRODUCTION: true
container_name: scheduler
image: swiple/swiple-api:main
restart: unless-stopped
command: ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8001"]
ports:
- "8001:8001"
volumes:
- $HOME/.aws:$HOME/.aws
- $HOME/.config/gcloud:/root/.config/gcloud
- $HOME\AppData\Roaming\gcloud:/root/.config/gcloud
depends_on: *swiple-depends-on
swiple_ui:
container_name: swiple_ui
image: swiple/swiple-ui:main
restart: unless-stopped
ports:
- "3000:3000"
depends_on:
- "swiple_api"
celery_worker:
container_name: celery_worker
env_file: docker/.env
command: celery --app=app.worker.app.celery_app worker -l info -c 4 -Ofair --without-heartbeat --without-gossip --without-mingle --loglevel=warning
image: swiple/swiple-api:latest
volumes:
- $PWD/backend/app/:/code/app/
- $HOME/.aws:$HOME/.aws
environment:
<<: *aws-creds
depends_on:
- swiple_api
setup:
env_file: docker/.env
container_name: setup
image: swiple/swiple-api:main
environment:
PRODUCTION: true
command: bash -c "
export PYTHONPATH=$PYTHONPATH:/code
&& cd app
&& reindexer init-index
&& reindexer run
&& python3 /code/app/scripts/create_admin_user.py
&& python3 /code/app/sample_data/load_data.py
"
depends_on: *swiple-depends-on
postgres:
container_name: postgresql
image: postgres:10.5
restart: unless-stopped
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
healthcheck:
test: /usr/bin/pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}
interval: 5s
timeout: 10s
retries: 10
ports:
- "5432:5432"
volumes:
- ./docker/postgres-data:/var/lib/postgresql/data
opensearch-node1:
image: opensearchproject/opensearch:2.3.0
restart: unless-stopped
container_name: opensearch-node1
environment:
- cluster.name=opensearch-cluster
- node.name=opensearch-node1
- bootstrap.memory_lock=true # along with the memlock settings below, disables swapping
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" # minimum and maximum Java heap size, recommend setting both to 50% of system RAM
- "discovery.type=single-node" # disables bootstrap checks that are enabled when network.host is set to a non-loopback address
- "plugins.security.audit.type=internal_opensearch"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536 # maximum number of open files for the OpenSearch user, set to at least 65536 on modern systems
hard: 65536
volumes:
- opensearch-data1:/usr/share/opensearch/data
ports:
- "9200:9200"
- "9600:9600" # required for Performance Analyzer
healthcheck:
test:
[
'CMD-SHELL',
'curl -XGET https://localhost:9200/_cluster/health -u "admin:admin" --silent --insecure || exit 1',
]
interval: 5s
timeout: 30s
retries: 10
opensearch-dashboards:
image: opensearchproject/opensearch-dashboards:2.3.0
container_name: opensearch-dashboards
restart: unless-stopped
ports:
- "5601:5601"
expose:
- "5601"
environment:
- 'OPENSEARCH_HOSTS=["https://opensearch-node1:9200"]'
redis:
image: "redis:7.0.0-alpine"
restart: unless-stopped
container_name: redis
command: redis-server
ports:
- "6379:6379"
expose:
- "6379"
volumes:
- ./docker/redis-data:/var/lib/redis
environment:
- REDIS_REPLICATION_MODE=master
volumes:
opensearch-data1: