Forked from dmontagu/docker-compose.deploy.volumes-placement.yml
Created
September 17, 2020 19:47
-
-
Save teserak/52022b9e8983d0798d90aff0025fc1ba to your computer and use it in GitHub Desktop.
Revisions
-
dmontagu revised this gist
May 13, 2019 . No changes.There are no files selected for viewing
-
dmontagu created this gist
May 13, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ version: '3.3' services: db: volumes: - app-db-data:/var/lib/postgresql/data/pgdata deploy: placement: constraints: - node.labels.${STACK_NAME}.app-db-data == true es01: volumes: - app-es-data-01:/usr/share/elasticsearch/data deploy: placement: constraints: - node.labels.${STACK_NAME}.app-es-data-01 == true es02: volumes: - app-es-data-02:/usr/share/elasticsearch/data deploy: placement: constraints: - node.labels.${STACK_NAME}.app-es-data-02 == true proxy: deploy: placement: constraints: - node.role == manager volumes: app-db-data: app-es-data-01: driver: local app-es-data-02: driver: local This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ version: '3.3' services: db: image: postgres:11 es01: image: elasticsearch:7.0.1 es02: image: elasticsearch:7.0.1 This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ version: '3.3' services: backend: depends_on: - db - es01 - es02 This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ version: '3.3' services: db: env_file: - env-postgres.env environment: - PGDATA=/var/lib/postgresql/data/pgdata es01: environment: - node.name=es01 - cluster.initial_master_nodes=es01,es02 - discovery.seed_hosts=es02 env_file: - env-elasticsearch.env ulimits: memlock: soft: -1 hard: -1 es02: environment: - node.name=es02 - cluster.initial_master_nodes=es01,es02 - discovery.seed_hosts=es01 env_file: - env-elasticsearch.env ulimits: memlock: soft: -1 hard: -1 backend: env_file: - env-postgres.env - env-backend.env - env-elasticsearch.env environment: - SERVER_NAME=${DOMAIN} - SERVER_HOST=https://${DOMAIN} This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ from elasticsearch import Elasticsearch from elasticsearch_async import AsyncElasticsearch from app.core import config ES_HOST = f"{config.elasticsearch_server}:{config.elasticsearch_port}" def get_elasticsearch() -> Elasticsearch: return Elasticsearch(hosts=[ES_HOST]) def get_async_elasticsearch(loop=None) -> AsyncElasticsearch: return AsyncElasticsearch(hosts=[ES_HOST], loop=loop) This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ # Used by elasticsearch service cluster.name=docker-cluster bootstrap.memory_lock=true "ES_JAVA_OPTS=-Xms512m -Xmx512m" # Used by backend service ELASTICSEARCH_SERVER=es01 ELASTICSEARCH_PORT=9200