updated staging deploys

This commit is contained in:
Blair Vanderlugt 2021-08-13 12:45:27 -07:00
parent f82730db85
commit 306f9ca184
12 changed files with 1173 additions and 107 deletions

9
.env
View File

@ -1,7 +1,4 @@
DOMAIN=localhost DOMAIN=localhost
# DOMAIN=local.dockertoolbox.tiangolo.com
# DOMAIN=localhost.tiangolo.com
# DOMAIN=dev.demo1.com
STACK_NAME=cic-net STACK_NAME=cic-net
@ -9,12 +6,6 @@ TRAEFIK_PUBLIC_NETWORK=traefik-public
TRAEFIK_TAG=cic.net TRAEFIK_TAG=cic.net
TRAEFIK_PUBLIC_TAG=traefik-public TRAEFIK_PUBLIC_TAG=traefik-public
#DOCKER_IMAGE_BACKEND=backend
#DOCKER_IMAGE_CELERYWORKER=celeryworker
#DOCKER_IMAGE_FRONTEND=frontend
# Flower # Flower
FLOWER_BASIC_AUTH=admin:changethis FLOWER_BASIC_AUTH=admin:changethis

View File

@ -12,8 +12,10 @@ image: tiangolo/docker-with-compose
before_script: before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- pip install docker-auto-labels
stages: stages:
- test
- build - build
- deploy - deploy
@ -21,24 +23,93 @@ variables:
DOCKER_BUILDKIT: 1 DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1 COMPOSE_DOCKER_CLI_BUILD: 1
#services: build-staging:
# - docker:stable-dind
build-prod:
tags: tags:
- integration - integration
stage: build stage: build
script: script:
- docker-compose build - TAG=stag FRONTEND_ENV=staging sh ./scripts/build-push.sh
only: only:
- bvander/integration-tests-on-docker - bvander/integration-tests-on-docker
deploy-prod: deploy-staging:
tags: tags:
- integration - integration
stage: deploy stage: deploy
script: script:
- docker stack deploy -c docker-compose.yml --with-registry-auth my-stack - >
DOMAIN=stag.grassrootseconomics.net
TRAEFIK_TAG=grassrootseconomics.net
STACK_NAME=stag-cic-net
TAG=stag
sh ./scripts/deploy.sh
environment:
name: staging
url: https://stag.grassrootseconomics.net
only: only:
- bvander/integration-tests-on-docker - bvander/integration-tests-on-docker
#tests:
# stage: test
# script:
# - sh ./scripts/test.sh
# tags:
# - build
# - test
#
#build-stag:
# stage: build
# script:
# - TAG=stag FRONTEND_ENV=staging sh ./scripts/build-push.sh
# only:
# - master
# tags:
# - build
# - test
#
#build-prod:
# stage: build
# script:
# - TAG=prod FRONTEND_ENV=production sh ./scripts/build-push.sh
# only:
# - production
# tags:
# - build
# - test
#
#deploy-stag:
# stage: deploy
# script:
# - >
# DOMAIN=stag.demo1.com
# TRAEFIK_TAG=stag.demo1.com
# STACK_NAME=stag-demo1-com
# TAG=stag
# sh ./scripts/deploy.sh
# environment:
# name: staging
# url: https://stag.demo1.com
# only:
# - master
# tags:
# - swarm
# - stag
#
#deploy-prod:
# stage: deploy
# script:
# - >
# DOMAIN=demo1.com
# TRAEFIK_TAG=demo1.com
# STACK_NAME=demo1-com
# TAG=prod
# sh ./scripts/deploy.sh
# environment:
# name: production
# url: https://demo1.com
# only:
# - production
# tags:
# - swarm
# - prod

View File

@ -6,11 +6,11 @@ export const environment = {
logLevel: NgxLoggerLevel.DEBUG, logLevel: NgxLoggerLevel.DEBUG,
serverLogLevel: NgxLoggerLevel.OFF, serverLogLevel: NgxLoggerLevel.OFF,
loggingUrl: '', loggingUrl: '',
cicMetaUrl: 'https://meta-auth.dev.grassrootseconomics.net:443', cicMetaUrl: 'http://localhost:63380',
publicKeysUrl: 'https://dev.grassrootseconomics.net/.well-known/publickeys/', publicKeysUrl: 'https://dev.grassrootseconomics.net/.well-known/publickeys/',
cicCacheUrl: 'https://cache.dev.grassrootseconomics.net', cicCacheUrl: 'http://localhost:63313',
web3Provider: 'wss://bloxberg-ws.dev.grassrootseconomics.net', web3Provider: 'http://localhost:8545',
cicUssdUrl: 'https://user.dev.grassrootseconomics.net', cicUssdUrl: 'http://localhost:63415',
registryAddress: '0xea6225212005e86a4490018ded4bf37f3e772161', registryAddress: '0xea6225212005e86a4490018ded4bf37f3e772161',
trustedDeclaratorAddress: '0xEb3907eCad74a0013c259D5874AE7f22DcBcC95C', trustedDeclaratorAddress: '0xEb3907eCad74a0013c259D5874AE7f22DcBcC95C',
dashboardUrl: 'https://dashboard.sarafu.network/', dashboardUrl: 'https://dashboard.sarafu.network/',

View File

@ -0,0 +1,17 @@
import { NgxLoggerLevel } from 'ngx-logger';
export const environment = {
production: false,
bloxbergChainId: 8996,
logLevel: NgxLoggerLevel.DEBUG,
serverLogLevel: NgxLoggerLevel.OFF,
loggingUrl: '',
cicMetaUrl: 'https://meta.staging.grassrootseconomics.net',
publicKeysUrl: 'https://dev.grassrootseconomics.net/.well-known/publickeys/',
cicCacheUrl: 'https://cache.staging.grassrootseconomics.net',
web3Provider: 'https://bloxberg.staging.grassrootseconomics.net',
cicUssdUrl: 'https://user.staging.grassrootseconomics.net',
registryAddress: '0xea6225212005e86a4490018ded4bf37f3e772161',
trustedDeclaratorAddress: '0xEb3907eCad74a0013c259D5874AE7f22DcBcC95C',
dashboardUrl: 'https://dashboard.sarafu.network/',
};

View File

@ -31,23 +31,35 @@ services:
postgres: postgres:
environment: environment:
POSTGRES_HOST_AUTH_METHOD: trust # for postgres user access w/o password. Obvioulsy not safe but allows easy elevated debugging. POSTGRES_HOST_AUTH_METHOD: trust # for postgres user access w/o password. Obvioulsy not safe but allows easy elevated debugging.
ports:
- ${DEV_POSTGRES_PORT:-63432}:5432
pgadmin: pgadmin:
ports: ports:
- "5050:5050" - "5050:5050"
# depends_on:
# - postgres
#
flower: flower:
ports: ports:
- "5555:5555" - "5555:5555"
cic-cache-server: eth:
restart: unless-stopped
ports: ports:
- "63313:8000" - ${DEV_ETH_PORT_HTTP:-63545}:8545
- ${DEV_ETH_PORT_WS:-63546}:8546
- 30303
labels: labels:
- traefik.enable=true - traefik.enable=true
- traefik.constraint-label-stack=${TRAEFIK_TAG?Variable not set} - traefik.constraint-label-stack=${TRAEFIK_TAG?Variable not set}
- traefik.http.routers.${STACK_NAME?Variable not set}-cache-http.rule=PathPrefix(`/cache`) - traefik.http.routers.${STACK_NAME?Variable not set}-bloxberg-http.rule=PathPrefix(`/`)
- traefik.http.services.${STACK_NAME?Variable not set}-cache.loadbalancer.server.port=80 - traefik.http.services.${STACK_NAME?Variable not set}-bloxberg.loadbalancer.server.port=8545
redis:
ports:
- ${DEV_REDIS_PORT:-63379}:6379
command: "--loglevel verbose"
cicada: cicada:
build: build:
@ -59,6 +71,104 @@ services:
- traefik.http.routers.${STACK_NAME?Variable not set}-frontend-http.rule=PathPrefix(`/`) - traefik.http.routers.${STACK_NAME?Variable not set}-frontend-http.rule=PathPrefix(`/`)
- traefik.http.services.${STACK_NAME?Variable not set}-frontend.loadbalancer.server.port=80 - traefik.http.services.${STACK_NAME?Variable not set}-frontend.loadbalancer.server.port=80
#contract-migration:
# depends_on:
# - eth
# - postgres
# - redis
# - cic-eth-tasker
#cic-cache-tracker:
# depends_on:
# - redis
# - postgres
# - eth
#cic-cache-tasker:
# depends_on:
# - redis
# - postgres
# - eth
cic-cache-server:
ports:
- "63313:8000"
#depends_on:
# - postgres
labels:
- traefik.enable=true
- traefik.constraint-label-stack=${TRAEFIK_TAG?Variable not set}
- traefik.http.routers.${STACK_NAME?Variable not set}-cache-http.rule=PathPrefix(`/`)
- traefik.http.services.${STACK_NAME?Variable not set}-cache.loadbalancer.server.port=63313
#cic-eth-tasker:
# depends_on:
# - eth
# - postgres
# - redis
#cic-eth-tracker:
# depends_on:
# - eth
# - postgres
# - redis
#cic-eth-dispatcher:
# depends_on:
# - eth
# - postgres
# - redis
#cic-eth-retrier:
# depends_on:
# - eth
# - postgres
# - redis
#cic-notify-tasker:
# depends_on:
# - postgres
# - redis
cic-meta-server:
ports:
- ${HTTP_PORT_CIC_META:-63380}:8000
#depends_on:
# - postgres
labels:
- traefik.enable=true
- traefik.constraint-label-stack=${TRAEFIK_TAG?Variable not set}
- traefik.http.routers.${STACK_NAME?Variable not set}-meta-http.rule=PathPrefix(`/`)
- traefik.http.services.${STACK_NAME?Variable not set}-meta.loadbalancer.server.port=63380
cic-user-ussd-server:
ports:
- ${HTTP_PORT_CIC_USER_USSD_SERVER:-63315}:9000
#depends_on:
# - postgres
# - redis
labels:
- traefik.enable=true
- traefik.constraint-label-stack=${TRAEFIK_TAG?Variable not set}
- traefik.http.routers.${STACK_NAME?Variable not set}-ussd-http.rule=PathPrefix(`/`)
- traefik.http.services.${STACK_NAME?Variable not set}-ussd.loadbalancer.server.port=63315
cic-user-server:
ports:
- ${HTTP_PORT_CIC_USER_SERVER:-63415}:9500
#depends_on:
# - postgres
labels:
- traefik.enable=true
- traefik.constraint-label-stack=${TRAEFIK_TAG?Variable not set}
- traefik.http.routers.${STACK_NAME?Variable not set}-user-http.rule=PathPrefix(`/`)
- traefik.http.services.${STACK_NAME?Variable not set}-user.loadbalancer.server.port=63415
# cic-user-tasker:
# depends_on:
# - postgres
# - redis
networks: networks:
traefik-public: traefik-public:
# For local dev, don't expect an external Traefik network # For local dev, don't expect an external Traefik network

View File

@ -91,23 +91,35 @@ services:
labels: labels:
- traefik.enable=true - traefik.enable=true
- traefik.constraint-label-stack=${TRAEFIK_TAG?Variable not set} - traefik.constraint-label-stack=${TRAEFIK_TAG?Variable not set}
- traefik.http.routers.${STACK_NAME?Variable not set}-frontend-http.rule=PathPrefix(`/`) - traefik.http.routers.${STACK_NAME?Variable not set}-cicada-http.rule=PathPrefix(`/`)
- traefik.http.services.${STACK_NAME?Variable not set}-frontend.loadbalancer.server.port=80 - traefik.http.services.${STACK_NAME?Variable not set}-cicada.loadbalancer.server.port=80
eth: eth:
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/bloxberg-node image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/bloxberg-node:${TAG:-latest}
env_file: env_file:
- .env - .env
build: build:
context: apps/bloxbergValidatorSetup context: apps/bloxbergValidatorSetup
restart: unless-stopped
ports: ports:
- ${DEV_ETH_PORT_HTTP:-63545}:8545 - 8545
- ${DEV_ETH_PORT_WS:-63546}:8546 - 8546
- 30303 - 30303
volumes: volumes:
- ./apps/bloxbergValidatorSetup/keys:/root/keys # stores the signing key locally - ./apps/bloxbergValidatorSetup/keys:/root/keys # stores the signing key locally
- bloxberg-data:/root/.local/share/io.parity.ethereum/ - bloxberg-data:/root/.local/share/io.parity.ethereum/
deploy:
labels:
- traefik.enable=true
- traefik.docker.network=${TRAEFIK_PUBLIC_NETWORK?Variable not set}
- traefik.constraint-label=${TRAEFIK_PUBLIC_TAG?Variable not set}
- traefik.http.routers.${STACK_NAME?Variable not set}-bloxberg-http.rule=Host(`bloxberg.${DOMAIN?Variable not set}`)
- traefik.http.routers.${STACK_NAME?Variable not set}-bloxberg-http.entrypoints=http
- traefik.http.routers.${STACK_NAME?Variable not set}-bloxberg-http.middlewares=${STACK_NAME?Variable not set}-https-redirect
- traefik.http.routers.${STACK_NAME?Variable not set}-bloxberg-https.rule=Host(`bloxberg.${DOMAIN?Variable not set}`)
- traefik.http.routers.${STACK_NAME?Variable not set}-bloxberg-https.entrypoints=https
- traefik.http.routers.${STACK_NAME?Variable not set}-bloxberg-https.tls=true
- traefik.http.routers.${STACK_NAME?Variable not set}-bloxberg-https.tls.certresolver=le
- traefik.http.services.${STACK_NAME?Variable not set}-bloxberg.loadbalancer.server.port=5050
# See contents of /initdb/create_db.sql for app user, password and databases # See contents of /initdb/create_db.sql for app user, password and databases
postgres: postgres:
@ -115,7 +127,7 @@ services:
env_file: env_file:
- .env - .env
ports: ports:
- ${DEV_POSTGRES_PORT:-63432}:5432 - 5432
command: [ "-c", "max_connections=200" ] command: [ "-c", "max_connections=200" ]
deploy: deploy:
placement: placement:
@ -130,16 +142,13 @@ services:
env_file: env_file:
- .env - .env
ports: ports:
- ${DEV_REDIS_PORT:-63379}:6379 - 6379
command: "--loglevel verbose"
pgadmin: pgadmin:
image: dpage/pgadmin4 image: dpage/pgadmin4
networks: networks:
- ${TRAEFIK_PUBLIC_NETWORK?Variable not set} - ${TRAEFIK_PUBLIC_NETWORK?Variable not set}
- default - default
depends_on:
- postgres
env_file: env_file:
- .env - .env
deploy: deploy:
@ -194,7 +203,7 @@ services:
- bee-data:/tmp/cic/bee - bee-data:/tmp/cic/bee
contract-migration: contract-migration:
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/contract-migration image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/contract-migration:${TAG:-latest}
build: build:
context: apps/contract-migration context: apps/contract-migration
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile
@ -228,16 +237,11 @@ services:
#CONFINI_DIR: ${CONFINI_DIR:-/tmp/cic/config} #CONFINI_DIR: ${CONFINI_DIR:-/tmp/cic/config}
command: ["./run_job.sh"] command: ["./run_job.sh"]
#command: ["./reset.sh"] #command: ["./reset.sh"]
depends_on:
- eth
- postgres
- redis
- cic-eth-tasker
volumes: volumes:
- contract-config:/tmp/cic/config - contract-config:/tmp/cic/config
data-seeding: data-seeding:
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/data-seeding image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/data-seeding:${TAG:-latest}
build: build:
context: apps/data-seeding context: apps/data-seeding
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile
@ -271,7 +275,7 @@ services:
- contract-config:/tmp/cic/config - contract-config:/tmp/cic/config
cic-cache-tracker: cic-cache-tracker:
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-cache image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-cache:${TAG:-latest}
build: build:
context: apps/cic-cache context: apps/cic-cache
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile
@ -294,10 +298,6 @@ services:
deploy: deploy:
restart_policy: restart_policy:
condition: on-failure condition: on-failure
depends_on:
- redis
- postgres
- eth
command: command:
- /bin/bash - /bin/bash
- -c - -c
@ -308,7 +308,7 @@ services:
- contract-config:/tmp/cic/config/:ro - contract-config:/tmp/cic/config/:ro
cic-cache-tasker: cic-cache-tasker:
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-cache image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-cache:${TAG:-latest}
build: build:
context: apps/cic-cache context: apps/cic-cache
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile
@ -332,10 +332,6 @@ services:
deploy: deploy:
restart_policy: restart_policy:
condition: on-failure condition: on-failure
depends_on:
- redis
- postgres
- eth
command: command:
- /bin/bash - /bin/bash
- -c - -c
@ -346,7 +342,7 @@ services:
- contract-config:/tmp/cic/config/:ro - contract-config:/tmp/cic/config/:ro
cic-cache-server: cic-cache-server:
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-cache image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-cache:${TAG:-latest}
build: build:
context: apps/cic-cache context: apps/cic-cache
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile
@ -361,8 +357,6 @@ services:
SERVER_PORT: 8000 SERVER_PORT: 8000
ports: ports:
- 8000 - 8000
depends_on:
- postgres
command: command:
- /bin/bash - /bin/bash
- -c - -c
@ -387,7 +381,7 @@ services:
- traefik.http.services.${STACK_NAME?Variable not set}-cache.loadbalancer.server.port=80 - traefik.http.services.${STACK_NAME?Variable not set}-cache.loadbalancer.server.port=80
cic-eth-tasker: cic-eth-tasker:
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-eth image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-eth:${TAG:-latest}
build: build:
context: apps/cic-eth context: apps/cic-eth
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile
@ -418,10 +412,6 @@ services:
ETH_ACCOUNT_ACCOUNTS_INDEX_WRITER: ${DEV_ETH_ACCOUNT_ACCOUNTS_INDEX_WRITER:-0xACB0BC74E1686D62dE7DC6414C999EA60C09F0eA} ETH_ACCOUNT_ACCOUNTS_INDEX_WRITER: ${DEV_ETH_ACCOUNT_ACCOUNTS_INDEX_WRITER:-0xACB0BC74E1686D62dE7DC6414C999EA60C09F0eA}
TASKS_TRACE_QUEUE_STATUS: ${TASKS_TRACE_QUEUE_STATUS:-1} TASKS_TRACE_QUEUE_STATUS: ${TASKS_TRACE_QUEUE_STATUS:-1}
CIC_DEFAULT_TOKEN_SYMBOL: ${CIC_DEFAULT_TOKEN_SYMBOL:-GFT} CIC_DEFAULT_TOKEN_SYMBOL: ${CIC_DEFAULT_TOKEN_SYMBOL:-GFT}
depends_on:
- eth
- postgres
- redis
deploy: deploy:
restart_policy: restart_policy:
condition: on-failure condition: on-failure
@ -437,7 +427,7 @@ services:
# command: [/bin/sh, "./start_tasker.sh", -q, cic-eth, -vv ] # command: [/bin/sh, "./start_tasker.sh", -q, cic-eth, -vv ]
cic-eth-tracker: cic-eth-tracker:
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-eth image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-eth:${TAG:-latest}
build: build:
context: apps/cic-eth context: apps/cic-eth
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile
@ -457,10 +447,6 @@ services:
CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://redis} CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://redis}
CELERY_RESULT_URL: ${CELERY_RESULT_URL:-redis://redis} CELERY_RESULT_URL: ${CELERY_RESULT_URL:-redis://redis}
TASKS_TRANSFER_CALLBACKS: $TASKS_TRANSFER_CALLBACKS TASKS_TRANSFER_CALLBACKS: $TASKS_TRANSFER_CALLBACKS
depends_on:
- eth
- postgres
- redis
deploy: deploy:
restart_policy: restart_policy:
condition: on-failure condition: on-failure
@ -476,7 +462,7 @@ services:
cic-eth-dispatcher: cic-eth-dispatcher:
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-eth image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-eth:${TAG:-latest}
build: build:
context: apps/cic-eth context: apps/cic-eth
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile
@ -497,10 +483,6 @@ services:
TASKS_TRANSFER_CALLBACKS: $TASKS_TRANSFER_CALLBACKS TASKS_TRANSFER_CALLBACKS: $TASKS_TRANSFER_CALLBACKS
DATABASE_DEBUG: ${DATABASE_DEBUG:-false} DATABASE_DEBUG: ${DATABASE_DEBUG:-false}
#DATABASE_DEBUG: 1 #DATABASE_DEBUG: 1
depends_on:
- eth
- postgres
- redis
deploy: deploy:
restart_policy: restart_policy:
condition: on-failure condition: on-failure
@ -516,7 +498,7 @@ services:
cic-eth-retrier: cic-eth-retrier:
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-eth image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-eth:${TAG:-latest}
build: build:
context: apps/cic-eth context: apps/cic-eth
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile
@ -539,10 +521,6 @@ services:
CIC_TX_RETRY_DELAY: 60 CIC_TX_RETRY_DELAY: 60
BATCH_SIZE: ${RETRIER_BATCH_SIZE:-50} BATCH_SIZE: ${RETRIER_BATCH_SIZE:-50}
#DATABASE_DEBUG: 1 #DATABASE_DEBUG: 1
depends_on:
- eth
- postgres
- redis
deploy: deploy:
restart_policy: restart_policy:
condition: on-failure condition: on-failure
@ -559,7 +537,7 @@ services:
cic-notify-tasker: cic-notify-tasker:
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-notify image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-notify:${TAG:-latest}
build: build:
context: apps/cic-notify context: apps/cic-notify
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile
@ -578,9 +556,6 @@ services:
AFRICASTALKING_API_USERNAME: $AFRICASTALKING_API_USERNAME AFRICASTALKING_API_USERNAME: $AFRICASTALKING_API_USERNAME
AFRICASTALKING_API_KEY: $AFRICASTALKING_API_KEY AFRICASTALKING_API_KEY: $AFRICASTALKING_API_KEY
AFRICASTALKING_API_SENDER_ID: $AFRICASTALKING_API_SENDER_ID AFRICASTALKING_API_SENDER_ID: $AFRICASTALKING_API_SENDER_ID
depends_on:
- postgres
- redis
deploy: deploy:
restart_policy: restart_policy:
condition: on-failure condition: on-failure
@ -588,7 +563,7 @@ services:
cic-meta-server: cic-meta-server:
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-meta image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-meta:${TAG:-latest}
hostname: meta hostname: meta
build: build:
context: apps/cic-meta context: apps/cic-meta
@ -611,18 +586,26 @@ services:
PGP_PUBLICKEY_ENCRYPT_FILE: publickeys.asc PGP_PUBLICKEY_ENCRYPT_FILE: publickeys.asc
SCHEMA_SQL_PATH: scripts/initdb/server.postgres.sql SCHEMA_SQL_PATH: scripts/initdb/server.postgres.sql
ports: ports:
- ${HTTP_PORT_CIC_META:-63380}:8000 - 8000
depends_on:
- postgres
deploy:
restart_policy:
condition: on-failure
volumes: volumes:
- ./apps/contract-migration/testdata/pgp/:/tmp/cic/pgp - ./apps/contract-migration/testdata/pgp/:/tmp/cic/pgp
deploy:
labels:
- traefik.enable=true
- traefik.docker.network=${TRAEFIK_PUBLIC_NETWORK?Variable not set}
- traefik.constraint-label=${TRAEFIK_PUBLIC_TAG?Variable not set}
- traefik.http.routers.${STACK_NAME?Variable not set}-meta-http.rule=Host(`meta.${DOMAIN?Variable not set}`)
- traefik.http.routers.${STACK_NAME?Variable not set}-meta-http.entrypoints=http
- traefik.http.routers.${STACK_NAME?Variable not set}-meta-http.middlewares=${STACK_NAME?Variable not set}-https-redirect
- traefik.http.routers.${STACK_NAME?Variable not set}-meta-https.rule=Host(`meta.${DOMAIN?Variable not set}`)
- traefik.http.routers.${STACK_NAME?Variable not set}-meta-https.entrypoints=https
- traefik.http.routers.${STACK_NAME?Variable not set}-meta-https.tls=true
- traefik.http.routers.${STACK_NAME?Variable not set}-meta-https.tls.certresolver=le
- traefik.http.services.${STACK_NAME?Variable not set}-meta.loadbalancer.server.port=80
# command: "/root/start_server.sh -vv" # command: "/root/start_server.sh -vv"
cic-user-ussd-server: cic-user-ussd-server:
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-ussd image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-ussd:${TAG:-latest}
build: build:
context: apps/cic-ussd context: apps/cic-ussd
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile
@ -641,19 +624,26 @@ services:
SERVER_PORT: 9000 SERVER_PORT: 9000
CIC_META_URL: ${CIC_META_URL:-http://meta:8000} CIC_META_URL: ${CIC_META_URL:-http://meta:8000}
ports: ports:
- ${HTTP_PORT_CIC_USER_USSD_SERVER:-63315}:9000 - 9000
depends_on:
- postgres
- redis
volumes: volumes:
- ./apps/contract-migration/testdata/pgp/:/usr/src/secrets/ - ./apps/contract-migration/testdata/pgp/:/usr/src/secrets/
deploy:
restart_policy:
condition: on-failure
command: "/root/start_cic_user_ussd_server.sh -vv" command: "/root/start_cic_user_ussd_server.sh -vv"
deploy:
labels:
- traefik.enable=true
- traefik.docker.network=${TRAEFIK_PUBLIC_NETWORK?Variable not set}
- traefik.constraint-label=${TRAEFIK_PUBLIC_TAG?Variable not set}
- traefik.http.routers.${STACK_NAME?Variable not set}-ussd-http.rule=Host(`ussd.${DOMAIN?Variable not set}`)
- traefik.http.routers.${STACK_NAME?Variable not set}-ussd-http.entrypoints=http
- traefik.http.routers.${STACK_NAME?Variable not set}-ussd-http.middlewares=${STACK_NAME?Variable not set}-https-redirect
- traefik.http.routers.${STACK_NAME?Variable not set}-ussd-https.rule=Host(`ussd.${DOMAIN?Variable not set}`)
- traefik.http.routers.${STACK_NAME?Variable not set}-ussd-https.entrypoints=https
- traefik.http.routers.${STACK_NAME?Variable not set}-ussd-https.tls=true
- traefik.http.routers.${STACK_NAME?Variable not set}-ussd-https.tls.certresolver=le
- traefik.http.services.${STACK_NAME?Variable not set}-ussd.loadbalancer.server.port=80
cic-user-server: cic-user-server:
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-ussd image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-ussd:${TAG:-latest}
build: build:
context: apps/cic-ussd context: apps/cic-ussd
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile
@ -668,16 +658,24 @@ services:
DATABASE_DRIVER: psycopg2 DATABASE_DRIVER: psycopg2
DATABASE_POOL_SIZE: 0 DATABASE_POOL_SIZE: 0
ports: ports:
- ${HTTP_PORT_CIC_USER_SERVER:-63415}:9500 - 9500
depends_on:
- postgres
deploy:
restart_policy:
condition: on-failure
command: "/root/start_cic_user_server.sh -vv" command: "/root/start_cic_user_server.sh -vv"
deploy:
labels:
- traefik.enable=true
- traefik.docker.network=${TRAEFIK_PUBLIC_NETWORK?Variable not set}
- traefik.constraint-label=${TRAEFIK_PUBLIC_TAG?Variable not set}
- traefik.http.routers.${STACK_NAME?Variable not set}-user-http.rule=Host(`user.${DOMAIN?Variable not set}`)
- traefik.http.routers.${STACK_NAME?Variable not set}-user-http.entrypoints=http
- traefik.http.routers.${STACK_NAME?Variable not set}-user-http.middlewares=${STACK_NAME?Variable not set}-https-redirect
- traefik.http.routers.${STACK_NAME?Variable not set}-user-https.rule=Host(`user.${DOMAIN?Variable not set}`)
- traefik.http.routers.${STACK_NAME?Variable not set}-user-https.entrypoints=https
- traefik.http.routers.${STACK_NAME?Variable not set}-user-https.tls=true
- traefik.http.routers.${STACK_NAME?Variable not set}-user-https.tls.certresolver=le
- traefik.http.services.${STACK_NAME?Variable not set}-user.loadbalancer.server.port=80
cic-user-tasker: cic-user-tasker:
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-ussd image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-ussd:${TAG:-latest}
build: build:
context: apps/cic-ussd/ context: apps/cic-ussd/
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile
@ -695,9 +693,6 @@ services:
CELERY_RESULT_URL: ${CELERY_BROKER_URL:-redis://redis} CELERY_RESULT_URL: ${CELERY_BROKER_URL:-redis://redis}
PGP_PASSPHRASE: merman PGP_PASSPHRASE: merman
CIC_META_URL: ${CIC_META_URL:-http://meta:8000} CIC_META_URL: ${CIC_META_URL:-http://meta:8000}
depends_on:
- postgres
- redis
volumes: volumes:
- ./apps/contract-migration/testdata/pgp/:/usr/src/secrets/ - ./apps/contract-migration/testdata/pgp/:/usr/src/secrets/
deploy: deploy:

813
docker-stack.yml Normal file
View File

@ -0,0 +1,813 @@
networks:
traefik-public:
external: false
services:
bee:
command: start --swap-enable=false --standalone
container_name: bee
environment:
BEE_NETWORK_ID: '313'
BEE_PASSWORD: password
CELERY_BROKER_URL: redis://redis:6379
CELERY_RESULT_URL: redis://redis:6379
CIC_CHAIN_SPEC: evm:bloxberg:8996
DATABASE_DRIVER: psycopg2
DATABASE_ENGINE: postgresql
DATABASE_HOST: postgres
DATABASE_NAME: cic_eth
DATABASE_PORT: '5432'
DATABASE_USER: postgres
DOMAIN: localhost
ETH_PROVIDER: http://eth:8545
FLOWER_BASIC_AUTH: admin:changethis
PGADMIN_DEFAULT_EMAIL: admin@cic.net
PGADMIN_DEFAULT_PASSWORD: changethis
PGADMIN_LISTEN_PORT: '5050'
REDIS_DB: '0'
REDIS_HOST: redis
REDIS_PORT: '6379'
STACK_NAME: cic-net
TRAEFIK_PUBLIC_NETWORK: traefik-public
TRAEFIK_PUBLIC_TAG: traefik-public
TRAEFIK_TAG: cic.net
image: ethersphere/bee:0.4.1
ports:
- published: 63633
target: 1633
- published: 63635
target: 1635
volumes:
- bee-data:/tmp/cic/bee:rw
cic-cache-server:
build:
context: /Users/blairvanderlugt/projects/GrassrootsEconomics/services/cic-internal-integration/apps/cic-cache
dockerfile: docker/Dockerfile
command:
- /bin/bash
- -c
- "if [[ -f /tmp/cic/config/.env ]]; then source /tmp/cic/config/.env; fi \n\"\
/usr/local/bin/uwsgi\" \\\n--wsgi-file /usr/src/cic-cache/cic_cache/runnable/daemons/server.py\
\ \\\n--http :8000 \\\n--pyargv \"-vv\"\n"
deploy:
labels:
traefik.constraint-label: traefik-public
traefik.docker.network: traefik-public
traefik.enable: "true"
traefik.http.routers.cic-net-cache-http.entrypoints: http
traefik.http.routers.cic-net-cache-http.middlewares: cic-net-https-redirect
traefik.http.routers.cic-net-cache-http.rule: Host(`cache.localhost`)
traefik.http.routers.cic-net-cache-https.entrypoints: https
traefik.http.routers.cic-net-cache-https.rule: Host(`cache.localhost`)
traefik.http.routers.cic-net-cache-https.tls: "true"
traefik.http.routers.cic-net-cache-https.tls.certresolver: le
traefik.http.services.cic-net-cache.loadbalancer.server.port: '80'
environment:
DATABASE_DEBUG: 1
DATABASE_HOST: postgres
DATABASE_NAME: cic_cache
DATABASE_PORT: '5432'
DATABASE_USER: postgres
SERVER_PORT: 8000
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-cache:latest
labels:
traefik.constraint-label-stack: cic.net
traefik.enable: "true"
traefik.http.routers.cic-net-cache-http.rule: PathPrefix(`/`)
traefik.http.services.cic-net-cache.loadbalancer.server.port: '63313'
ports:
- target: 8000
- published: 63313
target: 8000
cic-cache-tasker:
build:
context: /Users/blairvanderlugt/projects/GrassrootsEconomics/services/cic-internal-integration/apps/cic-cache
dockerfile: docker/Dockerfile
command:
- /bin/bash
- -c
- "if [[ -f /tmp/cic/config/.env ]]; then source /tmp/cic/config/.env; fi \n/usr/local/bin/cic-cache-taskerd\
\ -vv\n"
deploy:
restart_policy:
condition: on-failure
environment:
CELERY_BROKER_URL: redis://redis:6379
CELERY_RESULT_URL: redis://redis:6379
CIC_CHAIN_SPEC: evm:bloxberg:8996
CIC_REGISTRY_ADDRESS: ''
CIC_TRUST_ADDRESS: '0xEb3907eCad74a0013c259D5874AE7f22DcBcC95C'
DATABASE_DEBUG: 1
DATABASE_DRIVER: psycopg2
DATABASE_ENGINE: postgresql
DATABASE_HOST: postgres
DATABASE_NAME: cic_cache
DATABASE_PASSWORD: tralala
DATABASE_POOL_SIZE: 0
DATABASE_PORT: '5432'
DATABASE_USER: postgres
ETH_ABI_DIR: /usr/local/share/cic/solidity/abi
ETH_PROVIDER: http://eth:8545
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-cache:latest
volumes:
- contract-config:/tmp/cic/config:ro
cic-cache-tracker:
build:
context: /Users/blairvanderlugt/projects/GrassrootsEconomics/services/cic-internal-integration/apps/cic-cache
dockerfile: docker/Dockerfile
command:
- /bin/bash
- -c
- "if [[ -f /tmp/cic/config/.env ]]; then source /tmp/cic/config/.env; fi \n./start_tracker.sh\
\ -c /usr/local/etc/cic-cache -vv\n"
deploy:
restart_policy:
condition: on-failure
environment:
CELERY_BROKER_URL: redis://redis:6379
CELERY_RESULT_URL: redis://redis:6379
CIC_CHAIN_SPEC: evm:bloxberg:8996
CIC_REGISTRY_ADDRESS: ''
CIC_TRUST_ADDRESS: '0xEb3907eCad74a0013c259D5874AE7f22DcBcC95C'
DATABASE_DEBUG: 1
DATABASE_DRIVER: psycopg2
DATABASE_ENGINE: postgresql
DATABASE_HOST: postgres
DATABASE_NAME: cic_cache
DATABASE_PASSWORD: tralala
DATABASE_PORT: '5432'
DATABASE_USER: postgres
ETH_ABI_DIR: /usr/local/share/cic/solidity/abi
ETH_PROVIDER: http://eth:8545
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-cache:latest
volumes:
- contract-config:/tmp/cic/config:ro
cic-eth-dispatcher:
build:
context: /Users/blairvanderlugt/projects/GrassrootsEconomics/services/cic-internal-integration/apps/cic-eth
dockerfile: docker/Dockerfile
command:
- /bin/bash
- -c
- "if [[ -f /tmp/cic/config/.env ]]; then source /tmp/cic/config/.env; fi \n./start_dispatcher.sh\
\ -q cic-eth -vv\n"
deploy:
restart_policy:
condition: on-failure
environment:
CELERY_BROKER_URL: redis://redis:6379
CELERY_RESULT_URL: redis://redis:6379
CIC_CHAIN_SPEC: evm:bloxberg:8996
CIC_REGISTRY_ADDRESS: ''
DATABASE_DEBUG: "false"
DATABASE_DRIVER: psycopg2
DATABASE_ENGINE: postgresql
DATABASE_HOST: postgres
DATABASE_NAME: cic_eth
DATABASE_PASSWORD: tralala
DATABASE_PORT: '5432'
DATABASE_USER: postgres
ETH_PROVIDER: http://eth:8545
TASKS_TRANSFER_CALLBACKS: ''
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-eth:latest
volumes:
- contract-config:/tmp/cic/config:ro
cic-eth-retrier:
build:
context: /Users/blairvanderlugt/projects/GrassrootsEconomics/services/cic-internal-integration/apps/cic-eth
dockerfile: docker/Dockerfile
command:
- /bin/bash
- -c
- "if [[ -f /tmp/cic/config/.env ]]; then source /tmp/cic/config/.env; fi \n./start_retry.sh\
\ -vv \n"
deploy:
restart_policy:
condition: on-failure
environment:
BATCH_SIZE: '50'
CELERY_BROKER_URL: redis://redis:6379
CELERY_RESULT_URL: redis://redis:6379
CIC_CHAIN_SPEC: evm:bloxberg:8996
CIC_REGISTRY_ADDRESS: ''
CIC_TX_RETRY_DELAY: 60
DATABASE_DEBUG: '0'
DATABASE_DRIVER: psycopg2
DATABASE_ENGINE: postgresql
DATABASE_HOST: postgres
DATABASE_NAME: cic_eth
DATABASE_PASSWORD: tralala
DATABASE_PORT: '5432'
DATABASE_USER: postgres
ETH_PROVIDER: http://eth:8545
TASKS_TRANSFER_CALLBACKS: ''
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-eth:latest
volumes:
- contract-config:/tmp/cic/config:ro
cic-eth-tasker:
build:
context: /Users/blairvanderlugt/projects/GrassrootsEconomics/services/cic-internal-integration/apps/cic-eth
dockerfile: docker/Dockerfile
command:
- /bin/bash
- -c
- "if [[ -f /tmp/cic/config/.env ]]; then source /tmp/cic/config/.env; fi \n./start_tasker.sh\
\ --aux-all -q cic-eth -vv\n"
deploy:
restart_policy:
condition: on-failure
environment:
BANCOR_DIR: /usr/local/share/cic/bancor
CELERY_BROKER_URL: redis://redis:6379
CELERY_DEBUG: '1'
CELERY_RESULT_URL: redis://redis:6379
CIC_CHAIN_SPEC: evm:bloxberg:8996
CIC_DEFAULT_TOKEN_SYMBOL: GFT
CIC_REGISTRY_ADDRESS: ''
DATABASE_DEBUG: '0'
DATABASE_DRIVER: psycopg2
DATABASE_ENGINE: postgresql
DATABASE_HOST: postgres
DATABASE_NAME: cic_eth
DATABASE_PASSWORD: tralala
DATABASE_POOL_SIZE: 0
DATABASE_PORT: '5432'
DATABASE_USER: postgres
ETH_ABI_DIR: /usr/local/share/cic/solidity/abi
ETH_ACCOUNT_ACCOUNTS_INDEX_WRITER: '0xACB0BC74E1686D62dE7DC6414C999EA60C09F0eA'
ETH_GAS_PROVIDER_ADDRESS: ''
ETH_PROVIDER: http://eth:8545
PGPASSWORD: tralala
REDIS_HOST: redis
REDIS_PORT: 6379
SIGNER_SECRET: deadbeef
SIGNER_SOCKET_PATH: ipc:///run/crypto-dev-signer/jsonrpc.ipc
TASKS_TRACE_QUEUE_STATUS: '1'
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-eth:latest
volumes:
- contract-config:/tmp/cic/config:ro
- signer-data:/tmp/cic/signer:rw
cic-eth-tracker:
build:
context: /Users/blairvanderlugt/projects/GrassrootsEconomics/services/cic-internal-integration/apps/cic-eth
dockerfile: docker/Dockerfile
command:
- /bin/bash
- -c
- "if [[ -f /tmp/cic/config/.env ]]; then source /tmp/cic/config/.env; fi \n./start_tracker.sh\
\ -vv -c /usr/local/etc/cic-eth\n"
deploy:
restart_policy:
condition: on-failure
environment:
CELERY_BROKER_URL: redis://redis:6379
CELERY_RESULT_URL: redis://redis:6379
CIC_CHAIN_SPEC: evm:bloxberg:8996
CIC_REGISTRY_ADDRESS: ''
DATABASE_DEBUG: '0'
DATABASE_DRIVER: psycopg2
DATABASE_ENGINE: postgresql
DATABASE_HOST: postgres
DATABASE_NAME: cic_eth
DATABASE_PASSWORD: tralala
DATABASE_PORT: '5432'
DATABASE_USER: postgres
ETH_PROVIDER: http://eth:8545
TASKS_TRANSFER_CALLBACKS: ''
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-eth:latest
volumes:
- contract-config:/tmp/cic/config:ro
cic-meta-server:
build:
context: /Users/blairvanderlugt/projects/GrassrootsEconomics/services/cic-internal-integration/apps/cic-meta
dockerfile: docker/Dockerfile
deploy:
labels:
traefik.constraint-label: traefik-public
traefik.docker.network: traefik-public
traefik.enable: "true"
traefik.http.routers.cic-net-meta-http.entrypoints: http
traefik.http.routers.cic-net-meta-http.middlewares: cic-net-https-redirect
traefik.http.routers.cic-net-meta-http.rule: Host(`meta.localhost`)
traefik.http.routers.cic-net-meta-https.entrypoints: https
traefik.http.routers.cic-net-meta-https.rule: Host(`meta.localhost`)
traefik.http.routers.cic-net-meta-https.tls: "true"
traefik.http.routers.cic-net-meta-https.tls.certresolver: le
traefik.http.services.cic-net-meta.loadbalancer.server.port: '80'
environment:
DATABASE_DRIVER: psycopg2
DATABASE_ENGINE: postgresql
DATABASE_HOST: postgres
DATABASE_NAME: cic_eth
DATABASE_PORT: '5432'
DATABASE_SCHEMA_SQL_PATH: ''
DATABASE_USER: postgres
PGP_EXPORTS_DIR: /root/tests/
PGP_PASSPHRASE: merman
PGP_PRIVATEKEY_FILE: privatekeys.asc
PGP_PUBLICKEY_ACTIVE_FILE: publickeys.asc
PGP_PUBLICKEY_ENCRYPT_FILE: publickeys.asc
PGP_PUBLICKEY_TRUSTED_FILE: publickeys.asc
SCHEMA_SQL_PATH: scripts/initdb/server.postgres.sql
SERVER_HOST: localhost
SERVER_PORT: 8000
hostname: meta
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-meta:latest
labels:
traefik.constraint-label-stack: cic.net
traefik.enable: "true"
traefik.http.routers.cic-net-meta-http.rule: PathPrefix(`/`)
traefik.http.services.cic-net-meta.loadbalancer.server.port: '63380'
ports:
- target: 8000
- published: 63380
target: 8000
volumes:
- /Users/blairvanderlugt/projects/GrassrootsEconomics/services/cic-internal-integration/apps/contract-migration/testdata/pgp:/tmp/cic/pgp:rw
cic-notify-tasker:
build:
context: /Users/blairvanderlugt/projects/GrassrootsEconomics/services/cic-internal-integration/apps/cic-notify
dockerfile: docker/Dockerfile
command: /root/start_tasker.sh -q cic-notify -vv
deploy:
restart_policy:
condition: on-failure
environment:
AFRICASTALKING_API_KEY: ''
AFRICASTALKING_API_SENDER_ID: ''
AFRICASTALKING_API_USERNAME: ''
CELERY_BROKER_URL: redis://redis:6379
CELERY_RESULT_URL: redis://redis:6379
DATABASE_DRIVER: psycopg2
DATABASE_ENGINE: postgresql
DATABASE_HOST: postgres
DATABASE_NAME: cic_notify
DATABASE_PASSWORD: tralala
DATABASE_POOL_SIZE: 0
DATABASE_PORT: '5432'
DATABASE_USER: postgres
PGPASSWORD: tralala
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-notify:latest
cic-user-server:
build:
context: /Users/blairvanderlugt/projects/GrassrootsEconomics/services/cic-internal-integration/apps/cic-ussd
dockerfile: docker/Dockerfile
command: /root/start_cic_user_server.sh -vv
deploy:
labels:
traefik.constraint-label: traefik-public
traefik.docker.network: traefik-public
traefik.enable: "true"
traefik.http.routers.cic-net-user-http.entrypoints: http
traefik.http.routers.cic-net-user-http.middlewares: cic-net-https-redirect
traefik.http.routers.cic-net-user-http.rule: Host(`user.localhost`)
traefik.http.routers.cic-net-user-https.entrypoints: https
traefik.http.routers.cic-net-user-https.rule: Host(`user.localhost`)
traefik.http.routers.cic-net-user-https.tls: "true"
traefik.http.routers.cic-net-user-https.tls.certresolver: le
traefik.http.services.cic-net-user.loadbalancer.server.port: '80'
environment:
DATABASE_DRIVER: psycopg2
DATABASE_ENGINE: postgresql
DATABASE_HOST: postgres
DATABASE_NAME: cic_ussd
DATABASE_PASSWORD: tralala
DATABASE_POOL_SIZE: 0
DATABASE_PORT: 5432
DATABASE_USER: grassroots
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-ussd:latest
labels:
traefik.constraint-label-stack: cic.net
traefik.enable: "true"
traefik.http.routers.cic-net-user-http.rule: PathPrefix(`/`)
traefik.http.services.cic-net-user.loadbalancer.server.port: '63415'
ports:
- target: 9500
- published: 63415
target: 9500
cic-user-tasker:
build:
context: /Users/blairvanderlugt/projects/GrassrootsEconomics/services/cic-internal-integration/apps/cic-ussd
dockerfile: docker/Dockerfile
command: /root/start_cic_user_tasker.sh -q cic-ussd -vv
deploy:
restart_policy:
condition: on-failure
environment:
CELERY_BROKER_URL: redis://redis:6379
CELERY_RESULT_URL: redis://redis:6379
CIC_META_URL: http://meta:8000
DATABASE_DRIVER: psycopg2
DATABASE_ENGINE: postgresql
DATABASE_HOST: postgres
DATABASE_NAME: cic_ussd
DATABASE_PASSWORD: tralala
DATABASE_POOL_SIZE: 0
DATABASE_PORT: 5432
DATABASE_USER: grassroots
PGP_PASSPHRASE: merman
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-ussd:latest
volumes:
- /Users/blairvanderlugt/projects/GrassrootsEconomics/services/cic-internal-integration/apps/contract-migration/testdata/pgp:/usr/src/secrets:rw
cic-user-ussd-server:
build:
context: /Users/blairvanderlugt/projects/GrassrootsEconomics/services/cic-internal-integration/apps/cic-ussd
dockerfile: docker/Dockerfile
command: /root/start_cic_user_ussd_server.sh -vv
deploy:
labels:
traefik.constraint-label: traefik-public
traefik.docker.network: traefik-public
traefik.enable: "true"
traefik.http.routers.cic-net-ussd-http.entrypoints: http
traefik.http.routers.cic-net-ussd-http.middlewares: cic-net-https-redirect
traefik.http.routers.cic-net-ussd-http.rule: Host(`ussd.localhost`)
traefik.http.routers.cic-net-ussd-https.entrypoints: https
traefik.http.routers.cic-net-ussd-https.rule: Host(`ussd.localhost`)
traefik.http.routers.cic-net-ussd-https.tls: "true"
traefik.http.routers.cic-net-ussd-https.tls.certresolver: le
traefik.http.services.cic-net-ussd.loadbalancer.server.port: '80'
environment:
CELERY_BROKER_URL: redis://redis:6379
CELERY_RESULT_URL: redis://redis:6379
CIC_META_URL: http://meta:8000
DATABASE_DRIVER: psycopg2
DATABASE_ENGINE: postgresql
DATABASE_HOST: postgres
DATABASE_NAME: cic_ussd
DATABASE_PASSWORD: tralala
DATABASE_PORT: 5432
DATABASE_USER: grassroots
PGP_PASSPHRASE: merman
SERVER_PORT: 9000
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cic-ussd:latest
labels:
traefik.constraint-label-stack: cic.net
traefik.enable: "true"
traefik.http.routers.cic-net-ussd-http.rule: PathPrefix(`/`)
traefik.http.services.cic-net-ussd.loadbalancer.server.port: '63315'
ports:
- target: 9000
- published: 63315
target: 9000
volumes:
- /Users/blairvanderlugt/projects/GrassrootsEconomics/services/cic-internal-integration/apps/contract-migration/testdata/pgp:/usr/src/secrets:rw
cicada:
build:
args:
BUILD_ENV: dev
context: /Users/blairvanderlugt/projects/GrassrootsEconomics/services/cic-internal-integration/apps/cic-staff-client
deploy:
labels:
traefik.constraint-label-stack: cic.net
traefik.enable: "true"
traefik.http.routers.cic-net-cicada-http.rule: PathPrefix(`/`)
traefik.http.services.cic-net-cicada.loadbalancer.server.port: '80'
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/cicada:latest
labels:
traefik.constraint-label-stack: cic.net
traefik.enable: "true"
traefik.http.routers.cic-net-frontend-http.rule: PathPrefix(`/`)
traefik.http.services.cic-net-frontend.loadbalancer.server.port: '80'
contract-migration:
build:
args:
pip_extra_args: ''
pip_index_url: https://pypi.org/simple
context: /Users/blairvanderlugt/projects/GrassrootsEconomics/services/cic-internal-integration/apps/contract-migration
dockerfile: docker/Dockerfile
command:
- ./run_job.sh
environment:
CELERY_BROKER_URL: redis://redis:6379
CELERY_RESULT_URL: redis://redis:6379
CIC_CHAIN_SPEC: evm:bloxberg:8996
CIC_DATA_DIR: /tmp/cic/config
CIC_DEFAULT_TOKEN_SYMBOL: ''
DATABASE_DRIVER: psycopg2
DATABASE_ENGINE: postgresql
DATABASE_HOST: postgres
DATABASE_NAME: cic_eth
DATABASE_PORT: '5432'
DATABASE_USER: postgres
DEV_ETH_GAS_PRICE: '1'
DEV_FAUCET_AMOUNT: '0'
DEV_USE_DOCKER_WAIT_SCRIPT: 1
DOMAIN: localhost
ETH_PROVIDER: http://eth:8545
ETH_PROVIDER_HOST: eth
ETH_PROVIDER_PORT: 8545
FLOWER_BASIC_AUTH: admin:changethis
PGADMIN_DEFAULT_EMAIL: admin@cic.net
PGADMIN_DEFAULT_PASSWORD: changethis
PGADMIN_LISTEN_PORT: '5050'
REDIS_DB: '0'
REDIS_HOST: redis
REDIS_PORT: '6379'
RUN_MASK: '0'
STACK_NAME: cic-net
TOKEN_DECIMALS: ''
TOKEN_DEMURRAGE_LEVEL: '196454828847045000000000000000000'
TOKEN_NAME: ''
TOKEN_REDISTRIBUTION_PERIOD: ''
TOKEN_SINK_ADDRESS: ''
TOKEN_SUPPLY_LIMIT: ''
TOKEN_TYPE: ''
TRAEFIK_PUBLIC_NETWORK: traefik-public
TRAEFIK_PUBLIC_TAG: traefik-public
TRAEFIK_TAG: cic.net
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/contract-migration:latest
volumes:
- contract-config:/tmp/cic/config:rw
data-seeding:
build:
args:
pip_extra_args: ''
pip_index_url: https://pypi.org/simple
context: /Users/blairvanderlugt/projects/GrassrootsEconomics/services/cic-internal-integration/apps/data-seeding
dockerfile: docker/Dockerfile
command:
- bash
- ./scripts/run_job.sh
environment:
CELERY_BROKER_URL: redis://redis:6379
CELERY_RESULT_URL: redis://redis:6379
CIC_DATA_DIR: /tmp/cic/config
CIC_REGISTRY_ADDRESS: ''
DEV_USE_DOCKER_WAIT_SCRIPT: 1
ETH_PROVIDER: http://eth:8545
ETH_PROVIDER_HOST: eth
ETH_PROVIDER_PORT: 8545
KEYSTORE_FILE_PATH: /root/keystore/UTC--2021-01-08T17-18-44.521011372Z--eb3907ecad74a0013c259d5874ae7f22dcbcc95c
NUMBER_OF_USERS: 10
OUT_DIR: out
REDIS_DB: '0'
REDIS_HOST: redis
REDIS_PORT: '6379'
RUN_MASK: '0'
TOKEN_SYMBOL: GFT
USER_USSD_HOST: cic-user-ussd-server
USER_USSD_PORT: 9000
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/data-seeding:latest
volumes:
- contract-config:/tmp/cic/config:rw
eth:
build:
context: /Users/blairvanderlugt/projects/GrassrootsEconomics/services/cic-internal-integration/apps/bloxbergValidatorSetup
environment:
CELERY_BROKER_URL: redis://redis:6379
CELERY_RESULT_URL: redis://redis:6379
CIC_CHAIN_SPEC: evm:bloxberg:8996
DATABASE_DRIVER: psycopg2
DATABASE_ENGINE: postgresql
DATABASE_HOST: postgres
DATABASE_NAME: cic_eth
DATABASE_PORT: '5432'
DATABASE_USER: postgres
DOMAIN: localhost
ETH_PROVIDER: http://eth:8545
FLOWER_BASIC_AUTH: admin:changethis
PGADMIN_DEFAULT_EMAIL: admin@cic.net
PGADMIN_DEFAULT_PASSWORD: changethis
PGADMIN_LISTEN_PORT: '5050'
REDIS_DB: '0'
REDIS_HOST: redis
REDIS_PORT: '6379'
STACK_NAME: cic-net
TRAEFIK_PUBLIC_NETWORK: traefik-public
TRAEFIK_PUBLIC_TAG: traefik-public
TRAEFIK_TAG: cic.net
image: registry.gitlab.com/grassrootseconomics/cic-internal-integration/bloxberg-node:latest
labels:
traefik.constraint-label-stack: cic.net
traefik.enable: "true"
traefik.http.routers.cic-net-bloxberg-http.rule: PathPrefix(`/`)
traefik.http.services.cic-net-bloxberg.loadbalancer.server.port: '8545'
ports:
- target: 8545
- published: 63545
target: 8545
- target: 8546
- published: 63546
target: 8546
- target: 30303
restart: unless-stopped
volumes:
- bloxberg-data:/root/.local/share/io.parity.ethereum:rw
- /Users/blairvanderlugt/projects/GrassrootsEconomics/services/cic-internal-integration/apps/bloxbergValidatorSetup/keys:/root/keys:rw
flower:
command:
- celery
- --broker=redis://redis:6379
- flower
deploy:
labels:
traefik.constraint-label: traefik-public
traefik.docker.network: traefik-public
traefik.enable: "true"
traefik.http.routers.cic-net-flower-http.entrypoints: http
traefik.http.routers.cic-net-flower-http.middlewares: cic-net-https-redirect
traefik.http.routers.cic-net-flower-http.rule: Host(`flower.localhost`)
traefik.http.routers.cic-net-flower-https.entrypoints: https
traefik.http.routers.cic-net-flower-https.rule: Host(`flower.localhost`)
traefik.http.routers.cic-net-flower-https.tls: "true"
traefik.http.routers.cic-net-flower-https.tls.certresolver: le
traefik.http.services.cic-net-flower.loadbalancer.server.port: '5555'
environment:
CELERY_BROKER_URL: redis://redis:6379
CELERY_RESULT_URL: redis://redis:6379
CIC_CHAIN_SPEC: evm:bloxberg:8996
DATABASE_DRIVER: psycopg2
DATABASE_ENGINE: postgresql
DATABASE_HOST: postgres
DATABASE_NAME: cic_eth
DATABASE_PORT: '5432'
DATABASE_USER: postgres
DOMAIN: localhost
ETH_PROVIDER: http://eth:8545
FLOWER_BASIC_AUTH: admin:changethis
PGADMIN_DEFAULT_EMAIL: admin@cic.net
PGADMIN_DEFAULT_PASSWORD: changethis
PGADMIN_LISTEN_PORT: '5050'
REDIS_DB: '0'
REDIS_HOST: redis
REDIS_PORT: '6379'
STACK_NAME: cic-net
TRAEFIK_PUBLIC_NETWORK: traefik-public
TRAEFIK_PUBLIC_TAG: traefik-public
TRAEFIK_TAG: cic.net
image: mher/flower
networks:
default: {}
traefik-public: {}
ports:
- published: 5555
target: 5555
pgadmin:
deploy:
labels:
traefik.constraint-label: traefik-public
traefik.docker.network: traefik-public
traefik.enable: "true"
traefik.http.routers.cic-net-pgadmin-http.entrypoints: http
traefik.http.routers.cic-net-pgadmin-http.middlewares: cic-net-https-redirect
traefik.http.routers.cic-net-pgadmin-http.rule: Host(`pgadmin.localhost`)
traefik.http.routers.cic-net-pgadmin-https.entrypoints: https
traefik.http.routers.cic-net-pgadmin-https.rule: Host(`pgadmin.localhost`)
traefik.http.routers.cic-net-pgadmin-https.tls: "true"
traefik.http.routers.cic-net-pgadmin-https.tls.certresolver: le
traefik.http.services.cic-net-pgadmin.loadbalancer.server.port: '5050'
environment:
CELERY_BROKER_URL: redis://redis:6379
CELERY_RESULT_URL: redis://redis:6379
CIC_CHAIN_SPEC: evm:bloxberg:8996
DATABASE_DRIVER: psycopg2
DATABASE_ENGINE: postgresql
DATABASE_HOST: postgres
DATABASE_NAME: cic_eth
DATABASE_PORT: '5432'
DATABASE_USER: postgres
DOMAIN: localhost
ETH_PROVIDER: http://eth:8545
FLOWER_BASIC_AUTH: admin:changethis
PGADMIN_DEFAULT_EMAIL: admin@cic.net
PGADMIN_DEFAULT_PASSWORD: changethis
PGADMIN_LISTEN_PORT: '5050'
REDIS_DB: '0'
REDIS_HOST: redis
REDIS_PORT: '6379'
STACK_NAME: cic-net
TRAEFIK_PUBLIC_NETWORK: traefik-public
TRAEFIK_PUBLIC_TAG: traefik-public
TRAEFIK_TAG: cic.net
image: dpage/pgadmin4
networks:
default: {}
traefik-public: {}
ports:
- published: 5050
target: 5050
postgres:
command:
- -c
- max_connections=200
deploy:
placement:
constraints:
- node.labels.cic-net.app-db-data == true
- node.role==manager
environment:
CELERY_BROKER_URL: redis://redis:6379
CELERY_RESULT_URL: redis://redis:6379
CIC_CHAIN_SPEC: evm:bloxberg:8996
DATABASE_DRIVER: psycopg2
DATABASE_ENGINE: postgresql
DATABASE_HOST: postgres
DATABASE_NAME: cic_eth
DATABASE_PORT: '5432'
DATABASE_USER: postgres
DOMAIN: localhost
ETH_PROVIDER: http://eth:8545
FLOWER_BASIC_AUTH: admin:changethis
PGADMIN_DEFAULT_EMAIL: admin@cic.net
PGADMIN_DEFAULT_PASSWORD: changethis
PGADMIN_LISTEN_PORT: '5050'
POSTGRES_HOST_AUTH_METHOD: trust
REDIS_DB: '0'
REDIS_HOST: redis
REDIS_PORT: '6379'
STACK_NAME: cic-net
TRAEFIK_PUBLIC_NETWORK: traefik-public
TRAEFIK_PUBLIC_TAG: traefik-public
TRAEFIK_TAG: cic.net
image: postgres:12.5-alpine
ports:
- target: 5432
- published: 63432
target: 5432
volumes:
- /Users/blairvanderlugt/projects/GrassrootsEconomics/services/cic-internal-integration/scripts/initdb/create_db.sql:/docker-entrypoint-initdb.d/1-create_all_db.sql:rw
- postgres-db:/var/lib/postgresql/data:rw
proxy:
command:
- --providers.docker
- --providers.docker.constraints=Label(`traefik.constraint-label-stack`, `cic.net`)
- --providers.docker.exposedbydefault=false
- --accesslog
- --log
- --api
- --api.insecure=true
deploy:
labels:
traefik.constraint-label: traefik-public
traefik.docker.network: traefik-public
traefik.enable: "true"
traefik.http.middlewares.cic-net-https-redirect.redirectscheme.permanent: "true"
traefik.http.middlewares.cic-net-https-redirect.redirectscheme.scheme: https
traefik.http.middlewares.cic-net-www-redirect.redirectregex.regex: ^https?://(www.)?(localhost)/(.*)
traefik.http.middlewares.cic-net-www-redirect.redirectregex.replacement: https://localhost/$${3}
traefik.http.routers.cic-net-proxy-http.entrypoints: http
traefik.http.routers.cic-net-proxy-http.middlewares: cic-net-www-redirect,cic-net-https-redirect
traefik.http.routers.cic-net-proxy-http.rule: Host(`localhost`) || Host(`www.localhost`)
traefik.http.routers.cic-net-proxy-https.entrypoints: https
traefik.http.routers.cic-net-proxy-https.middlewares: cic-net-www-redirect
traefik.http.routers.cic-net-proxy-https.rule: Host(`localhost`) || Host(`www.localhost`)
traefik.http.routers.cic-net-proxy-https.tls: "true"
traefik.http.routers.cic-net-proxy-https.tls.certresolver: le
traefik.http.services.cic-net-proxy.loadbalancer.server.port: '80'
placement:
constraints:
- node.role == manager
image: traefik:v2.2
labels:
traefik.enable: "true"
traefik.http.routers.cic-net-traefik-public-http.rule: Host(`localhost`)
traefik.http.services.cic-net-traefik-public.loadbalancer.server.port: '80'
networks:
default: {}
traefik-public: {}
ports:
- published: 80
target: 80
- published: 8090
target: 8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock:rw
redis:
command: --loglevel verbose
environment:
CELERY_BROKER_URL: redis://redis:6379
CELERY_RESULT_URL: redis://redis:6379
CIC_CHAIN_SPEC: evm:bloxberg:8996
DATABASE_DRIVER: psycopg2
DATABASE_ENGINE: postgresql
DATABASE_HOST: postgres
DATABASE_NAME: cic_eth
DATABASE_PORT: '5432'
DATABASE_USER: postgres
DOMAIN: localhost
ETH_PROVIDER: http://eth:8545
FLOWER_BASIC_AUTH: admin:changethis
PGADMIN_DEFAULT_EMAIL: admin@cic.net
PGADMIN_DEFAULT_PASSWORD: changethis
PGADMIN_LISTEN_PORT: '5050'
REDIS_DB: '0'
REDIS_HOST: redis
REDIS_PORT: '6379'
STACK_NAME: cic-net
TRAEFIK_PUBLIC_NETWORK: traefik-public
TRAEFIK_PUBLIC_TAG: traefik-public
TRAEFIK_TAG: cic.net
image: redis:6.0.9-alpine
ports:
- target: 6379
- published: 63379
target: 6379
version: '3.9'
volumes:
bee-data: {}
bloxberg-data: {}
contract-config: {}
ganache-db: {}
postgres-db: {}
signer-data: {}

10
scripts/build-push.sh Normal file
View File

@ -0,0 +1,10 @@
#! /usr/bin/env sh
# Exit in case of error
set -e
TAG=${TAG?Variable not set} \
FRONTEND_ENV=${FRONTEND_ENV-production} \
sh ./scripts/build.sh
docker-compose -f docker-compose.yml push

10
scripts/build.sh Normal file
View File

@ -0,0 +1,10 @@
#! /usr/bin/env sh
# Exit in case of error
set -e
TAG=${TAG?Variable not set} \
FRONTEND_ENV=${FRONTEND_ENV-production} \
docker-compose \
-f docker-compose.yml \
build

16
scripts/deploy.sh Normal file
View File

@ -0,0 +1,16 @@
#! /usr/bin/env sh
# Exit in case of error
set -e
DOMAIN=${DOMAIN?Variable not set} \
TRAEFIK_TAG=${TRAEFIK_TAG?Variable not set} \
STACK_NAME=${STACK_NAME?Variable not set} \
TAG=${TAG?Variable not set} \
docker-compose \
-f docker-compose.yml \
config > docker-stack.yml
docker-auto-labels docker-stack.yml
docker stack deploy -c docker-stack.yml --with-registry-auth "${STACK_NAME?Variable not set}"

15
scripts/test-local.sh Normal file
View File

@ -0,0 +1,15 @@
#! /usr/bin/env bash
# Exit in case of error
set -e
docker-compose down -v --remove-orphans # Remove possibly previous broken stacks left hanging after an error
if [ $(uname -s) = "Linux" ]; then
echo "Remove __pycache__ files"
sudo find . -type d -name __pycache__ -exec rm -r {} \+
fi
docker-compose build
docker-compose up -d
docker-compose exec -T backend bash /app/tests-start.sh "$@"

18
scripts/test.sh Normal file
View File

@ -0,0 +1,18 @@
#! /usr/bin/env sh
# Exit in case of error
set -e
DOMAIN=backend \
SMTP_HOST="" \
TRAEFIK_PUBLIC_NETWORK_IS_EXTERNAL=false \
INSTALL_DEV=true \
docker-compose \
-f docker-compose.yml \
config > docker-stack.yml
docker-compose -f docker-stack.yml build
docker-compose -f docker-stack.yml down -v --remove-orphans # Remove possibly previous broken stacks left hanging after an error
docker-compose -f docker-stack.yml up -d
docker-compose -f docker-stack.yml exec -T backend bash /app/tests-start.sh "$@"
docker-compose -f docker-stack.yml down -v --remove-orphans