Commit 5ba8f3b6 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Minor refactoring of infrastructure docker-compose [skip-ci]

parent 2bc9016a
Pipeline #81070 skipped
## Run (dev) infrastructure components with docker compose
You can all necessary databases and other infrastructure with [docker-compose](https://docs.docker.com/compose/)
You can run all necessary databases and other infrastructure with [docker-compose](https://docs.docker.com/compose/)
on a single node/computer that supports docker and docker-compse.
### How we use docker-compose
......@@ -8,11 +8,18 @@ on a single node/computer that supports docker and docker-compse.
You can use docker-compose to run all necessary databases with one single docker-compose configuration.
The `docker-compose.yml` defines all the different container.
To run the infrastructure for a typical development environment (where you need mongodb,
elastic, and rabbitmq), simply run:
```
docker-compose up -d mongo elastic rabbitmq
```
We use docker-compose overrides to extend a base configuration for different scenarios.
Example docker-compose usage:
Example docker-compose usage for starting the production infrastructure:
```
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d mongo rabbitmq elastic
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d mongo rabbitmq elastic keycloak elk
```
The different overrides are:
......
......@@ -15,21 +15,6 @@
version: '3.4'
services:
# broker for celery
rabbitmq:
ports:
- 5672:5672
# the search engine
elastic:
ports:
- 9200:9200
# the user data db
mongo:
ports:
- 27017:27017
# used for centralized logging
elk:
restart: always
......
......@@ -19,21 +19,3 @@ services:
keycloak:
environment:
- DB_VENDOR=h2
# broker for celery
rabbitmq:
restart: 'no'
ports:
- 5672:5672
# the search engine
elastic:
restart: 'no'
ports:
- 9200:9200
# the user data db
mongo:
restart: 'no'
ports:
- 27017:27017
......@@ -17,21 +17,24 @@ version: '3.4'
services:
# keycloak for user management
keycloak:
restart: unless-stopped
volumes:
- /nomad/fairdi/db/keycloak:/opt/jboss/keycloak/standalone/data
- /nomad/backup/fairdi/keycloak:/export
# broker for celery
rabbitmq:
restart: unless-stopped
# the search engine
elastic:
ports:
- 9200:9200
restart: always
volumes:
- /scratch/fairdi/db/elastic:/usr/share/elasticsearch/data
# the user data db
mongo:
ports:
- 27017:27017
restart: always
volumes:
- /scratch/fairdi/db/mongo:/data/db
......
......@@ -24,7 +24,7 @@ x-common-variables: &nomad_backend_env
services:
# keycload for user management
keycloak:
restart: unless-stopped
restart: 'no'
build: ../../containers/keycloak/
image: nomad/keycloak
container_name: nomad_keycloak
......@@ -35,7 +35,7 @@ services:
# broker for celery
rabbitmq:
restart: unless-stopped
restart: 'no'
image: rabbitmq:3.7.17
container_name: nomad_rabbitmq
environment:
......@@ -43,25 +43,31 @@ services:
- RABBITMQ_DEFAULT_USER=rabbitmq
- RABBITMQ_DEFAULT_PASS=rabbitmq
- RABBITMQ_DEFAULT_VHOST=/
ports:
- 5672:5672
volumes:
- nomad_rabbitmq:/var/lib/rabbitmq
# the search engine
elastic:
restart: always
restart: 'no'
image: docker.elastic.co/elasticsearch/elasticsearch:6.3.2
container_name: nomad_elastic
ports:
- 9200:9200
volumes:
- nomad_elastic:/usr/share/elasticsearch/data
# the user data db
mongo:
restart: always
restart: 'no'
image: mongo:4
container_name: nomad_mongo
environment:
- MONGO_DATA_DIR=/data/db
- MONGO_LOG_DIR=/dev/null
ports:
- 27017:27017
volumes:
- nomad_mongo:/data/db
command: mongod --logpath=/dev/null # --quiet
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment