version: "3" volumes: data-volume: {} # an empty dir that can be earased by dropping the volume: docker-compose down -v services: postgres: image: postgres:12.5-alpine container_name: cic_postgres environment: POSTGRES_USER: ${DATABASE_USER:-postgres} POSTGRES_PASSWORD: ${DATABASE_PASSWORD:-password} POSTGRES_DB: postgres ports: - 63432:5432 restart: always volumes: - ./db/initdb_files/create_all_db.sql:/docker-entrypoint-initdb.d/1-create_all_db.sql #note these run in order - data-volume:/var/lib/postgresql/data db-migration: build: context: . environment: ETH_PROVIDER: ${ETH_PROVIDER:-wss://bloxberg-ws.dev.grassrootseconomics.net/} # CIC_REGISTRY_ADDRESS: ${CIC_REGISTRY_ADDRESS:?err} # TODO are there any public addresses we can use for a default? CIC_REGISTRY_ADDRESS: $CIC_REGISTRY_ADDRESS BANCOR_DIR: $BANCOR_DIR # is this required? DATABASE_HOST: postgres # because it's set in the postgres service block as well as port DATABASE_PORT: 5432 DATABASE_USER: ${DATABASE_USER:-postgres} DATABASE_PASSWORD: ${DATABASE_PASSWORD:-password} DATABASE_NAME: ${DATABASE_NAME_CIC_CACHE:-cic-cache} DATABASE_ENGINE: postgres DATABASE_DRIVER: psycopg2 command: [ "/usr/local/bin/wait-for-it/wait-for-it.sh", "postgres:5432", "--", "migrate.py", "-c", "/usr/local/etc/cic-cache", "--migrations-dir", "/usr/local/share/cic-cache/alembic", "-vv" ] depends_on: - postgres cic-cache-tracker: build: context: . # https://docs.docker.com/compose/compose-file/#variable-substitution environment: ETH_PROVIDER: ${ETH_PROVIDER:-wss://bloxberg-ws.dev.grassrootseconomics.net/} # CIC_REGISTRY_ADDRESS: ${CIC_REGISTRY_ADDRESS:?err} # TODO are there any public addresses we can use for a default? CIC_REGISTRY_ADDRESS: $CIC_REGISTRY_ADDRESS BANCOR_DIR: $BANCOR_DIR # is this required? DATABASE_HOST: postgres # because it's set in the postgres service block as well as port DATABASE_PORT: 5432 DATABASE_USER: ${DATABASE_USER:-postgres} DATABASE_PASSWORD: ${DATABASE_PASSWORD:-password} DATABASE_NAME: ${DATABASE_NAME_CIC_CACHE:-"cic-cache"} DATABASE_ENGINE: postgres DATABASE_DRIVER: psycopg2 # deploy: # restart_policy: # condition: on-failure entrypoint: ["/usr/local/bin/cic-cache-tracker", "-vv"] depends_on: - postgres - db-migration cic-cache-server: build: context: . environment: DATABASE_HOST: ${DATABASE_HOST:-postgres} DATABASE_PORT: 5432 DATABASE_USER: ${DATABASE_USER:-postgres} DATABASE_PASSWORD: ${DATABASE_PASSWORD:-password} DATABASE_NAME: ${DATABASE_NAME_CIC_CACHE:-"cic-cache"} SERVER_PORT: 80 ports: - 63313:80 # deploy: # restart_policy: # condition: on-failure entrypoint: [ "/usr/local/bin/uwsgi", "--wsgi-file", "/usr/local/lib/python3.8/site-packages/cic_cache/runnable/server.py", "--http", ":80", "--pyargv", "-vv" ] depends_on: - postgres - db-migration