-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from osstotalsoft/feature/docker-compose
Feature/docker compose
- Loading branch information
Showing
22 changed files
with
3,544 additions
and
2,882 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
version: '2.3' | ||
|
||
services: | ||
conductor-server: | ||
environment: | ||
- CONFIG_PROP=config-local.properties | ||
- ES_VERSION=6 | ||
- INDEXING_ENABLED=true | ||
- "-Dpolyglot.engine.WarnInterpreterOnly=false" | ||
image: niemen/conductor-server:6.2.5 | ||
networks: | ||
- internal | ||
ports: | ||
- 8080:8080 | ||
- 8090:8090 | ||
healthcheck: | ||
test: ["CMD", "curl","-I" ,"-XGET", "http://localhost:8080/health"] | ||
interval: 60s | ||
timeout: 30s | ||
retries: 12 | ||
links: | ||
- elasticsearch:es | ||
depends_on: | ||
redis: | ||
condition: service_healthy | ||
elasticsearch: | ||
condition: service_healthy | ||
logging: | ||
driver: "json-file" | ||
options: | ||
max-size: "1k" | ||
max-file: "3" | ||
|
||
conductor-ui: | ||
environment: | ||
- WF_SERVER=http://conductor-server:8080 | ||
image: niemen/conductor-ui:4.0.0 | ||
networks: | ||
- internal | ||
ports: | ||
- 5001:5000 | ||
|
||
redis: | ||
image: redis:6.2-alpine | ||
restart: always | ||
networks: | ||
- internal | ||
ports: | ||
- '6379:6379' | ||
command: redis-server --save 20 1 --loglevel warning | ||
healthcheck: | ||
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ] | ||
interval: 10s | ||
timeout: 10s | ||
retries: 12 | ||
volumes: | ||
- redis:/data | ||
|
||
elasticsearch: | ||
image: elasticsearch:6.8.23 | ||
environment: | ||
- "ES_JAVA_OPTS=-Xms512m -Xmx1024m" | ||
- transport.host=0.0.0.0 | ||
- discovery.type=single-node | ||
- xpack.security.enabled=false | ||
volumes: | ||
- es6data-conductor:/usr/share/elasticsearch/data | ||
networks: | ||
- internal | ||
ports: | ||
- 9200:9200 | ||
- 9300:9300 | ||
healthcheck: | ||
test: timeout 5 bash -c 'cat < /dev/null > /dev/tcp/localhost/9300' | ||
interval: 5s | ||
timeout: 5s | ||
retries: 12 | ||
logging: | ||
driver: "json-file" | ||
options: | ||
max-size: "1k" | ||
max-file: "3" | ||
|
||
nats: | ||
image: nats-streaming:latest | ||
networks: | ||
- internal | ||
ports: | ||
- 4222:4222 | ||
- 8222:8222 | ||
|
||
schellar: | ||
profiles: ["scheduler"] | ||
image: flaviostutz/schellar | ||
environment: | ||
- CONDUCTOR_API_URL=http://conductor-server:8080/api | ||
- MONGO_ADDRESS=mongo | ||
- MONGO_USERNAME=root | ||
- MONGO_PASSWORD=root | ||
- LOG_LEVEL=info | ||
networks: | ||
- internal | ||
ports: | ||
- 3001:3000 | ||
depends_on: | ||
- "conductor-server" | ||
logging: | ||
driver: "json-file" | ||
options: | ||
max-size: "20MB" | ||
max-file: "5" | ||
|
||
mongo: | ||
image: mongo:4.1.10 | ||
profiles: ["scheduler"] | ||
networks: | ||
- internal | ||
environment: | ||
- MONGO_INITDB_ROOT_USERNAME=root | ||
- MONGO_INITDB_ROOT_PASSWORD=root | ||
ports: | ||
- 27017-27019:27017-27019 | ||
|
||
volumes: | ||
es6data-conductor: | ||
driver: local | ||
redis: | ||
driver: local | ||
|
||
networks: | ||
internal: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,35 @@ | ||
const { Client } = require("@elastic/elasticsearch"); | ||
const { snapshots_body, logs_body } = require("./config"); | ||
const { elasticLogs, workflowSnapshots } = require("./registeredIndexes"); | ||
const { ELASTIC_VERSION } = process.env; | ||
|
||
const { ELASTIC_SEARCH_HOST, ELASTIC_USER, ELASTIC_PASSWORD } = process.env; | ||
if (+ELASTIC_VERSION === 6) { | ||
const { | ||
esSchema, | ||
esClient, | ||
initElastic, | ||
search, | ||
seed, | ||
} = require("./clientes6"); | ||
|
||
const esSchema = { | ||
size: 1000, | ||
from: 0, | ||
track_total_hits: false, | ||
query: { | ||
match_all: {}, | ||
}, | ||
}; | ||
module.exports = { | ||
esSchema, | ||
esClient, | ||
initElastic, | ||
search, | ||
seed, | ||
}; | ||
} else { | ||
const { | ||
esSchema, | ||
esClient, | ||
initElastic, | ||
search, | ||
seed, | ||
} = require("./clientes8"); | ||
|
||
const esClient = new Client({ | ||
node: ELASTIC_SEARCH_HOST, | ||
auth: { | ||
username: ELASTIC_USER, | ||
password: ELASTIC_PASSWORD, | ||
}, | ||
pingTimeout: 60000, | ||
}); | ||
|
||
async function initializeIndex(indexName, body) { | ||
const { body: exists } = await esClient.indices.exists({ index: indexName }); | ||
if (exists) console.log(`index "${indexName}" already created`); | ||
else { | ||
console.log(`index "${indexName}" is missing. Creating...`); | ||
await esClient.indices.create({ | ||
index: indexName, | ||
body, | ||
}); | ||
console.log(`index "${indexName}" created`); | ||
} | ||
module.exports = { | ||
esSchema, | ||
esClient, | ||
initElastic, | ||
seed, | ||
search, | ||
}; | ||
} | ||
|
||
esClient.ping(function (error) { | ||
if (error) throw new TypeError("ElasticSearch cluster is down!"); | ||
else { | ||
initializeIndex(workflowSnapshots.index, snapshots_body); | ||
initializeIndex(elasticLogs.index, logs_body); | ||
console.log("ElasticSearch is ok"); | ||
} | ||
}); | ||
|
||
module.exports = { | ||
esSchema, | ||
esClient, | ||
}; |
Oops, something went wrong.