bigchaindb/docker-compose.yml

106 lines
2.8 KiB
YAML
Raw Normal View History

# Copyright © 2020 Interplanetary Database Association e.V.,
# BigchainDB and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
version: '2.2'
2016-02-10 19:55:33 +01:00
services:
Problem: standardize docker-compose workflows (#2130) - Standardize docker-compose workflow - Change docker-compose version to 2.1 - why one might ask? because compose version 3.0 does not support depends on and inherits like we want to and is more aimed towards migration to using `docker stack`, for our current strategy `2.1` is a better choice. - change `bdb` service `bigchaindb` service - why? Introduced a new proxy service `bdb` which is just a dummy `busybox` image. - why? because this ensure via healthcheck of bigchaindb that BigchainDB has started properly and makes a `curl` to ensure HTTP API server is up and running. - why? Because we have had scenarios where BigchainDB is not started via docker compose and user has to check out the logs to find out what the problem might be. This ensure that bigchaindb is up and running. - Does this change deployment workflow? No. - The only thing change is that if you want to run commands inside a bigchaindb container e.g. `pytest` now you have to run the following command: `docker-compose run --rm --no-deps bigchaindb pytest -v --cov=bigchaindb` as opposed to `docker-compose run --rm --no-deps bdb pytest -v --cov=bigchaindb` - Remove env variable `BIGCHAINDB_START_TENDERMINT` - Remove TENDERMINT_INTEGRATION.rst and move to the new docs - Change mdb -> mongodb because the other services were named with full name. - Add example to run specific tests or from a file - Update config.toml for tendermint to use `bigchaindb` as proxy app instead of `bdb` - Remove `network` directory because it is deprecated - Add comment about why PYTHONBUFFERED is used
2018-03-21 12:42:43 +01:00
# Build: docker-compose build -d bigchaindb
# Run: docker-compose run -d bdb
mongodb:
image: mongo:3.6
ports:
- "27017:27017"
command: mongod
restart: always
Problem: standardize docker-compose workflows (#2130) - Standardize docker-compose workflow - Change docker-compose version to 2.1 - why one might ask? because compose version 3.0 does not support depends on and inherits like we want to and is more aimed towards migration to using `docker stack`, for our current strategy `2.1` is a better choice. - change `bdb` service `bigchaindb` service - why? Introduced a new proxy service `bdb` which is just a dummy `busybox` image. - why? because this ensure via healthcheck of bigchaindb that BigchainDB has started properly and makes a `curl` to ensure HTTP API server is up and running. - why? Because we have had scenarios where BigchainDB is not started via docker compose and user has to check out the logs to find out what the problem might be. This ensure that bigchaindb is up and running. - Does this change deployment workflow? No. - The only thing change is that if you want to run commands inside a bigchaindb container e.g. `pytest` now you have to run the following command: `docker-compose run --rm --no-deps bigchaindb pytest -v --cov=bigchaindb` as opposed to `docker-compose run --rm --no-deps bdb pytest -v --cov=bigchaindb` - Remove env variable `BIGCHAINDB_START_TENDERMINT` - Remove TENDERMINT_INTEGRATION.rst and move to the new docs - Change mdb -> mongodb because the other services were named with full name. - Add example to run specific tests or from a file - Update config.toml for tendermint to use `bigchaindb` as proxy app instead of `bdb` - Remove `network` directory because it is deprecated - Add comment about why PYTHONBUFFERED is used
2018-03-21 12:42:43 +01:00
bigchaindb:
depends_on:
- mongodb
- tendermint
build:
context: .
dockerfile: Dockerfile-dev
volumes:
- ./bigchaindb:/usr/src/app/bigchaindb
- ./tests:/usr/src/app/tests
- ./docs:/usr/src/app/docs
- ./htmlcov:/usr/src/app/htmlcov
- ./setup.py:/usr/src/app/setup.py
- ./setup.cfg:/usr/src/app/setup.cfg
- ./pytest.ini:/usr/src/app/pytest.ini
- ./tox.ini:/usr/src/app/tox.ini
environment:
BIGCHAINDB_DATABASE_BACKEND: localmongodb
Problem: standardize docker-compose workflows (#2130) - Standardize docker-compose workflow - Change docker-compose version to 2.1 - why one might ask? because compose version 3.0 does not support depends on and inherits like we want to and is more aimed towards migration to using `docker stack`, for our current strategy `2.1` is a better choice. - change `bdb` service `bigchaindb` service - why? Introduced a new proxy service `bdb` which is just a dummy `busybox` image. - why? because this ensure via healthcheck of bigchaindb that BigchainDB has started properly and makes a `curl` to ensure HTTP API server is up and running. - why? Because we have had scenarios where BigchainDB is not started via docker compose and user has to check out the logs to find out what the problem might be. This ensure that bigchaindb is up and running. - Does this change deployment workflow? No. - The only thing change is that if you want to run commands inside a bigchaindb container e.g. `pytest` now you have to run the following command: `docker-compose run --rm --no-deps bigchaindb pytest -v --cov=bigchaindb` as opposed to `docker-compose run --rm --no-deps bdb pytest -v --cov=bigchaindb` - Remove env variable `BIGCHAINDB_START_TENDERMINT` - Remove TENDERMINT_INTEGRATION.rst and move to the new docs - Change mdb -> mongodb because the other services were named with full name. - Add example to run specific tests or from a file - Update config.toml for tendermint to use `bigchaindb` as proxy app instead of `bdb` - Remove `network` directory because it is deprecated - Add comment about why PYTHONBUFFERED is used
2018-03-21 12:42:43 +01:00
BIGCHAINDB_DATABASE_HOST: mongodb
BIGCHAINDB_DATABASE_PORT: 27017
BIGCHAINDB_SERVER_BIND: 0.0.0.0:9984
BIGCHAINDB_WSSERVER_HOST: 0.0.0.0
BIGCHAINDB_WSSERVER_ADVERTISED_HOST: bigchaindb
Problem: standardize docker-compose workflows (#2130) - Standardize docker-compose workflow - Change docker-compose version to 2.1 - why one might ask? because compose version 3.0 does not support depends on and inherits like we want to and is more aimed towards migration to using `docker stack`, for our current strategy `2.1` is a better choice. - change `bdb` service `bigchaindb` service - why? Introduced a new proxy service `bdb` which is just a dummy `busybox` image. - why? because this ensure via healthcheck of bigchaindb that BigchainDB has started properly and makes a `curl` to ensure HTTP API server is up and running. - why? Because we have had scenarios where BigchainDB is not started via docker compose and user has to check out the logs to find out what the problem might be. This ensure that bigchaindb is up and running. - Does this change deployment workflow? No. - The only thing change is that if you want to run commands inside a bigchaindb container e.g. `pytest` now you have to run the following command: `docker-compose run --rm --no-deps bigchaindb pytest -v --cov=bigchaindb` as opposed to `docker-compose run --rm --no-deps bdb pytest -v --cov=bigchaindb` - Remove env variable `BIGCHAINDB_START_TENDERMINT` - Remove TENDERMINT_INTEGRATION.rst and move to the new docs - Change mdb -> mongodb because the other services were named with full name. - Add example to run specific tests or from a file - Update config.toml for tendermint to use `bigchaindb` as proxy app instead of `bdb` - Remove `network` directory because it is deprecated - Add comment about why PYTHONBUFFERED is used
2018-03-21 12:42:43 +01:00
BIGCHAINDB_TENDERMINT_HOST: tendermint
BIGCHAINDB_TENDERMINT_PORT: 26657
ports:
- "9984:9984"
- "9985:9985"
- "26658"
Problem: standardize docker-compose workflows (#2130) - Standardize docker-compose workflow - Change docker-compose version to 2.1 - why one might ask? because compose version 3.0 does not support depends on and inherits like we want to and is more aimed towards migration to using `docker stack`, for our current strategy `2.1` is a better choice. - change `bdb` service `bigchaindb` service - why? Introduced a new proxy service `bdb` which is just a dummy `busybox` image. - why? because this ensure via healthcheck of bigchaindb that BigchainDB has started properly and makes a `curl` to ensure HTTP API server is up and running. - why? Because we have had scenarios where BigchainDB is not started via docker compose and user has to check out the logs to find out what the problem might be. This ensure that bigchaindb is up and running. - Does this change deployment workflow? No. - The only thing change is that if you want to run commands inside a bigchaindb container e.g. `pytest` now you have to run the following command: `docker-compose run --rm --no-deps bigchaindb pytest -v --cov=bigchaindb` as opposed to `docker-compose run --rm --no-deps bdb pytest -v --cov=bigchaindb` - Remove env variable `BIGCHAINDB_START_TENDERMINT` - Remove TENDERMINT_INTEGRATION.rst and move to the new docs - Change mdb -> mongodb because the other services were named with full name. - Add example to run specific tests or from a file - Update config.toml for tendermint to use `bigchaindb` as proxy app instead of `bdb` - Remove `network` directory because it is deprecated - Add comment about why PYTHONBUFFERED is used
2018-03-21 12:42:43 +01:00
healthcheck:
test: ["CMD", "bash", "-c", "curl http://bigchaindb:9984 && curl http://tendermint:26657/abci_query"]
Problem: standardize docker-compose workflows (#2130) - Standardize docker-compose workflow - Change docker-compose version to 2.1 - why one might ask? because compose version 3.0 does not support depends on and inherits like we want to and is more aimed towards migration to using `docker stack`, for our current strategy `2.1` is a better choice. - change `bdb` service `bigchaindb` service - why? Introduced a new proxy service `bdb` which is just a dummy `busybox` image. - why? because this ensure via healthcheck of bigchaindb that BigchainDB has started properly and makes a `curl` to ensure HTTP API server is up and running. - why? Because we have had scenarios where BigchainDB is not started via docker compose and user has to check out the logs to find out what the problem might be. This ensure that bigchaindb is up and running. - Does this change deployment workflow? No. - The only thing change is that if you want to run commands inside a bigchaindb container e.g. `pytest` now you have to run the following command: `docker-compose run --rm --no-deps bigchaindb pytest -v --cov=bigchaindb` as opposed to `docker-compose run --rm --no-deps bdb pytest -v --cov=bigchaindb` - Remove env variable `BIGCHAINDB_START_TENDERMINT` - Remove TENDERMINT_INTEGRATION.rst and move to the new docs - Change mdb -> mongodb because the other services were named with full name. - Add example to run specific tests or from a file - Update config.toml for tendermint to use `bigchaindb` as proxy app instead of `bdb` - Remove `network` directory because it is deprecated - Add comment about why PYTHONBUFFERED is used
2018-03-21 12:42:43 +01:00
interval: 3s
timeout: 5s
retries: 3
command: '.ci/entrypoint.sh'
restart: always
Problem: standardize docker-compose workflows (#2130) - Standardize docker-compose workflow - Change docker-compose version to 2.1 - why one might ask? because compose version 3.0 does not support depends on and inherits like we want to and is more aimed towards migration to using `docker stack`, for our current strategy `2.1` is a better choice. - change `bdb` service `bigchaindb` service - why? Introduced a new proxy service `bdb` which is just a dummy `busybox` image. - why? because this ensure via healthcheck of bigchaindb that BigchainDB has started properly and makes a `curl` to ensure HTTP API server is up and running. - why? Because we have had scenarios where BigchainDB is not started via docker compose and user has to check out the logs to find out what the problem might be. This ensure that bigchaindb is up and running. - Does this change deployment workflow? No. - The only thing change is that if you want to run commands inside a bigchaindb container e.g. `pytest` now you have to run the following command: `docker-compose run --rm --no-deps bigchaindb pytest -v --cov=bigchaindb` as opposed to `docker-compose run --rm --no-deps bdb pytest -v --cov=bigchaindb` - Remove env variable `BIGCHAINDB_START_TENDERMINT` - Remove TENDERMINT_INTEGRATION.rst and move to the new docs - Change mdb -> mongodb because the other services were named with full name. - Add example to run specific tests or from a file - Update config.toml for tendermint to use `bigchaindb` as proxy app instead of `bdb` - Remove `network` directory because it is deprecated - Add comment about why PYTHONBUFFERED is used
2018-03-21 12:42:43 +01:00
tendermint:
image: tendermint/tendermint:v0.31.5
# volumes:
# - ./tmdata:/tendermint
Problem: standardize docker-compose workflows (#2130) - Standardize docker-compose workflow - Change docker-compose version to 2.1 - why one might ask? because compose version 3.0 does not support depends on and inherits like we want to and is more aimed towards migration to using `docker stack`, for our current strategy `2.1` is a better choice. - change `bdb` service `bigchaindb` service - why? Introduced a new proxy service `bdb` which is just a dummy `busybox` image. - why? because this ensure via healthcheck of bigchaindb that BigchainDB has started properly and makes a `curl` to ensure HTTP API server is up and running. - why? Because we have had scenarios where BigchainDB is not started via docker compose and user has to check out the logs to find out what the problem might be. This ensure that bigchaindb is up and running. - Does this change deployment workflow? No. - The only thing change is that if you want to run commands inside a bigchaindb container e.g. `pytest` now you have to run the following command: `docker-compose run --rm --no-deps bigchaindb pytest -v --cov=bigchaindb` as opposed to `docker-compose run --rm --no-deps bdb pytest -v --cov=bigchaindb` - Remove env variable `BIGCHAINDB_START_TENDERMINT` - Remove TENDERMINT_INTEGRATION.rst and move to the new docs - Change mdb -> mongodb because the other services were named with full name. - Add example to run specific tests or from a file - Update config.toml for tendermint to use `bigchaindb` as proxy app instead of `bdb` - Remove `network` directory because it is deprecated - Add comment about why PYTHONBUFFERED is used
2018-03-21 12:42:43 +01:00
entrypoint: ''
ports:
- "26656:26656"
- "26657:26657"
command: sh -c "tendermint init && tendermint node --consensus.create_empty_blocks=false --proxy_app=tcp://bigchaindb:26658"
restart: always
Problem: standardize docker-compose workflows (#2130) - Standardize docker-compose workflow - Change docker-compose version to 2.1 - why one might ask? because compose version 3.0 does not support depends on and inherits like we want to and is more aimed towards migration to using `docker stack`, for our current strategy `2.1` is a better choice. - change `bdb` service `bigchaindb` service - why? Introduced a new proxy service `bdb` which is just a dummy `busybox` image. - why? because this ensure via healthcheck of bigchaindb that BigchainDB has started properly and makes a `curl` to ensure HTTP API server is up and running. - why? Because we have had scenarios where BigchainDB is not started via docker compose and user has to check out the logs to find out what the problem might be. This ensure that bigchaindb is up and running. - Does this change deployment workflow? No. - The only thing change is that if you want to run commands inside a bigchaindb container e.g. `pytest` now you have to run the following command: `docker-compose run --rm --no-deps bigchaindb pytest -v --cov=bigchaindb` as opposed to `docker-compose run --rm --no-deps bdb pytest -v --cov=bigchaindb` - Remove env variable `BIGCHAINDB_START_TENDERMINT` - Remove TENDERMINT_INTEGRATION.rst and move to the new docs - Change mdb -> mongodb because the other services were named with full name. - Add example to run specific tests or from a file - Update config.toml for tendermint to use `bigchaindb` as proxy app instead of `bdb` - Remove `network` directory because it is deprecated - Add comment about why PYTHONBUFFERED is used
2018-03-21 12:42:43 +01:00
bdb:
image: busybox
depends_on:
bigchaindb:
condition: service_healthy
# curl client to check the health of development env
curl-client:
image: appropriate/curl
command: /bin/sh -c "curl -s http://bigchaindb:9984/ > /dev/null && curl -s http://tendermint:26657/ > /dev/null"
Problem: standardize docker-compose workflows (#2130) - Standardize docker-compose workflow - Change docker-compose version to 2.1 - why one might ask? because compose version 3.0 does not support depends on and inherits like we want to and is more aimed towards migration to using `docker stack`, for our current strategy `2.1` is a better choice. - change `bdb` service `bigchaindb` service - why? Introduced a new proxy service `bdb` which is just a dummy `busybox` image. - why? because this ensure via healthcheck of bigchaindb that BigchainDB has started properly and makes a `curl` to ensure HTTP API server is up and running. - why? Because we have had scenarios where BigchainDB is not started via docker compose and user has to check out the logs to find out what the problem might be. This ensure that bigchaindb is up and running. - Does this change deployment workflow? No. - The only thing change is that if you want to run commands inside a bigchaindb container e.g. `pytest` now you have to run the following command: `docker-compose run --rm --no-deps bigchaindb pytest -v --cov=bigchaindb` as opposed to `docker-compose run --rm --no-deps bdb pytest -v --cov=bigchaindb` - Remove env variable `BIGCHAINDB_START_TENDERMINT` - Remove TENDERMINT_INTEGRATION.rst and move to the new docs - Change mdb -> mongodb because the other services were named with full name. - Add example to run specific tests or from a file - Update config.toml for tendermint to use `bigchaindb` as proxy app instead of `bdb` - Remove `network` directory because it is deprecated - Add comment about why PYTHONBUFFERED is used
2018-03-21 12:42:43 +01:00
# BigchainDB setup to do acceptance testing with Python
python-acceptance:
Problem: standardize docker-compose workflows (#2130) - Standardize docker-compose workflow - Change docker-compose version to 2.1 - why one might ask? because compose version 3.0 does not support depends on and inherits like we want to and is more aimed towards migration to using `docker stack`, for our current strategy `2.1` is a better choice. - change `bdb` service `bigchaindb` service - why? Introduced a new proxy service `bdb` which is just a dummy `busybox` image. - why? because this ensure via healthcheck of bigchaindb that BigchainDB has started properly and makes a `curl` to ensure HTTP API server is up and running. - why? Because we have had scenarios where BigchainDB is not started via docker compose and user has to check out the logs to find out what the problem might be. This ensure that bigchaindb is up and running. - Does this change deployment workflow? No. - The only thing change is that if you want to run commands inside a bigchaindb container e.g. `pytest` now you have to run the following command: `docker-compose run --rm --no-deps bigchaindb pytest -v --cov=bigchaindb` as opposed to `docker-compose run --rm --no-deps bdb pytest -v --cov=bigchaindb` - Remove env variable `BIGCHAINDB_START_TENDERMINT` - Remove TENDERMINT_INTEGRATION.rst and move to the new docs - Change mdb -> mongodb because the other services were named with full name. - Add example to run specific tests or from a file - Update config.toml for tendermint to use `bigchaindb` as proxy app instead of `bdb` - Remove `network` directory because it is deprecated - Add comment about why PYTHONBUFFERED is used
2018-03-21 12:42:43 +01:00
build:
context: .
dockerfile: ./acceptance/python/Dockerfile
volumes:
- ./acceptance/python/docs:/docs
- ./acceptance/python/src:/src
environment:
- BIGCHAINDB_ENDPOINT=bigchaindb
Problem: standardize docker-compose workflows (#2130) - Standardize docker-compose workflow - Change docker-compose version to 2.1 - why one might ask? because compose version 3.0 does not support depends on and inherits like we want to and is more aimed towards migration to using `docker stack`, for our current strategy `2.1` is a better choice. - change `bdb` service `bigchaindb` service - why? Introduced a new proxy service `bdb` which is just a dummy `busybox` image. - why? because this ensure via healthcheck of bigchaindb that BigchainDB has started properly and makes a `curl` to ensure HTTP API server is up and running. - why? Because we have had scenarios where BigchainDB is not started via docker compose and user has to check out the logs to find out what the problem might be. This ensure that bigchaindb is up and running. - Does this change deployment workflow? No. - The only thing change is that if you want to run commands inside a bigchaindb container e.g. `pytest` now you have to run the following command: `docker-compose run --rm --no-deps bigchaindb pytest -v --cov=bigchaindb` as opposed to `docker-compose run --rm --no-deps bdb pytest -v --cov=bigchaindb` - Remove env variable `BIGCHAINDB_START_TENDERMINT` - Remove TENDERMINT_INTEGRATION.rst and move to the new docs - Change mdb -> mongodb because the other services were named with full name. - Add example to run specific tests or from a file - Update config.toml for tendermint to use `bigchaindb` as proxy app instead of `bdb` - Remove `network` directory because it is deprecated - Add comment about why PYTHONBUFFERED is used
2018-03-21 12:42:43 +01:00
# Build docs only
# docker-compose build bdocs
# docker-compose up -d bdocs
bdocs:
depends_on:
- vdocs
build:
context: .
dockerfile: Dockerfile-dev
args:
backend: localmongodb
volumes:
- .:/usr/src/app/
command: make -C docs/root html
Problem: standardize docker-compose workflows (#2130) - Standardize docker-compose workflow - Change docker-compose version to 2.1 - why one might ask? because compose version 3.0 does not support depends on and inherits like we want to and is more aimed towards migration to using `docker stack`, for our current strategy `2.1` is a better choice. - change `bdb` service `bigchaindb` service - why? Introduced a new proxy service `bdb` which is just a dummy `busybox` image. - why? because this ensure via healthcheck of bigchaindb that BigchainDB has started properly and makes a `curl` to ensure HTTP API server is up and running. - why? Because we have had scenarios where BigchainDB is not started via docker compose and user has to check out the logs to find out what the problem might be. This ensure that bigchaindb is up and running. - Does this change deployment workflow? No. - The only thing change is that if you want to run commands inside a bigchaindb container e.g. `pytest` now you have to run the following command: `docker-compose run --rm --no-deps bigchaindb pytest -v --cov=bigchaindb` as opposed to `docker-compose run --rm --no-deps bdb pytest -v --cov=bigchaindb` - Remove env variable `BIGCHAINDB_START_TENDERMINT` - Remove TENDERMINT_INTEGRATION.rst and move to the new docs - Change mdb -> mongodb because the other services were named with full name. - Add example to run specific tests or from a file - Update config.toml for tendermint to use `bigchaindb` as proxy app instead of `bdb` - Remove `network` directory because it is deprecated - Add comment about why PYTHONBUFFERED is used
2018-03-21 12:42:43 +01:00
vdocs:
image: nginx
ports:
- '33333:80'
volumes:
- ./docs/root/build/html:/usr/share/nginx/html