-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
202 lines (183 loc) · 4.78 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
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
version: "3.7"
# YAML Anchors
x-deployment-env: &deployment-env
ENV: ${ENV:-development}
SG_ENV: ${SG_ENV:-development}
x-elastic-client-env: &elastic-client-env
ELASTIC_HOST: ${ELASTIC_HOST:-elastic}
ELASTIC_PORT: ${ELASTIC_PORT:-9200}
x-redis-client-env: &redis-client-env
REDIS_URL: ${REDIS_URL:-redis://redis:6379}
x-postgresdb-client-env: &postgresdb-client-env
PG_HOST: ${PG_HOST:-postgres}
PG_PORT: ${PG_PORT:-5432}
PG_DB: ${PG_DB:-place_development}
PG_USER: ${PG_USER:-postgres}
PG_PASSWORD: ${PG_PASSWORD:-password}
PG_DATABASE: ${PG_DATABASE:-place_development}
PG_DATABASE_URL: ${PG_DATABASE_URL:-postgresql://postgres:password@postgres:5432/place_development}
x-search-ingest-client-env: &search-ingest-client-env
SEARCH_INGEST_URI: ${SEARCH_INGEST_URI:-http://search-ingest:3000}
x-s3-client-env: &s3-client-env
AWS_REGION: ${AWS_REGION:-"us-east-1"}
AWS_KEY: ${AWS_KEY:-"root"}
AWS_SECRET: ${AWS_SECRET:-"password"}
AWS_S3_ENDPOINT: ${AWS_S3_ENDPOINT:-"http://minio:9000"}
AWS_S3_BUCKET: ${AWS_S3_BUCKET:-"placeos-drivers-build-service"}
x-build-api-env: &build-api-env
BUILD_API_HOST: ${BUILD_API_HOST:-build_service}
BUILD_API_PORT: ${BUILD_API_PORT:-3000}
services:
test: # Rest API
image: placeos/service-spec-runner:${CRYSTAL_VERSION:-latest}
volumes:
- ${PWD}/spec:/app/spec
- ${PWD}/src:/app/src
- ${PWD}/lib:/app/lib
- ${PWD}/shard.lock:/app/shard.lock
- ${PWD}/shard.override.yml:/app/shard.override.yml
- ${PWD}/shard.yml:/app/shard.yml.input
- ${PWD}/coverage:/app/coverage
depends_on:
- core
- elastic
- redis
- postgres
- migrator
- search-ingest
security_opt:
- seccomp:unconfined
environment:
# Environment
GITHUB_ACTION: ${GITHUB_ACTION:-}
<<: [
*deployment-env,
# Service Hosts
*elastic-client-env,
*redis-client-env,
*postgresdb-client-env,
]
elastic:
image: elasticsearch:${ELASTIC_VERSION:-7.17.6}
restart: always
hostname: elastic
healthcheck:
test: wget -q --no-verbose --tries=1 --spider http://localhost:9200/_cat/health
environment:
discovery.type: single-node
ES_JAVA_OPTS: -Xms1g -Xmx1g
http.cors.enabled: "true"
http.cors.allow-origin: http://localhost:8080
ports:
- 9200:9200
redis:
image: eqalpha/keydb
restart: always
hostname: redis
healthcheck:
test: redis-cli ping
ports:
- 6379:6379
postgres:
hostname: postgres
image: postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 30s
timeout: 30s
retries: 3
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: place_development
ports:
- 5432:5432
migrator:
build:
context: ${PWD}/spec/migration
container_name: migrator
depends_on:
postgres:
condition: service_healthy
environment:
GITHUB_ACTION: ${GITHUB_ACTION:-}
PG_DATABASE_URL: ${PG_DATABASE_URL:-postgresql://postgres:password@postgres:5432/place_development}
search-ingest: # PostgreSQL to Elasticsearch Service
image: placeos/search-ingest:nightly
restart: always
hostname: search-ingest
depends_on:
- elastic
- migrator
- postgres
environment:
LOG_LEVEL: trace
# Service Hosts
<<: [
*postgresdb-client-env,
*elastic-client-env,
# Environment
*deployment-env,
]
core: # Module coordinator
image: placeos/core:nightly
restart: always
hostname: core
depends_on:
- redis
- migrator
- postgres
- build_service
ulimits:
nofile: 40000
core:
soft: 0
hard: 0
healthcheck:
start_period: 30s
environment:
# Service Hosts
<<: [
*redis-client-env,
*postgresdb-client-env,
# Environment
*deployment-env,
# Build API
*build-api-env,
]
build_service:
image: placeos/build_service:nightly
restart: always
hostname: build_service
depends_on:
- minio
- testbucket
environment:
<<: *s3-client-env
minio:
image: minio/minio:latest
volumes:
- s3:/data
ports:
- 9000:9000
- 9090:9090
environment:
<< : *s3-client-env
MINIO_ROOT_USER: $AWS_KEY
MINIO_ROOT_PASSWORD: $AWS_SECRET
command: server /data --console-address ":9090"
testbucket:
image: minio/mc:latest
depends_on:
- minio
environment:
<< : *s3-client-env
entrypoint: >
sh -c '
sleep 3 &&
mc config host add s3 $AWS_S3_ENDPOINT $AWS_KEY $AWS_SECRET &&
mc mb -p s3/$AWS_S3_BUCKET &&
exit 0
'
volumes:
s3: