|
| 1 | +name: human-protocol-local-dev |
| 2 | + |
| 3 | +x-service-default-config: |
| 4 | + restart: &default-restart unless-stopped |
| 5 | + logging: &default-logging |
| 6 | + options: |
| 7 | + max-size: 10m |
| 8 | + max-file: 3 |
| 9 | + |
| 10 | +x-hardcoded-vars: |
| 11 | + graph_db_user: &graph_db_user graph-node |
| 12 | + graph_db_passwrod: &graph_db_passwrod let-me-in |
| 13 | + graph_db_name: &graph_db_name graph-node |
| 14 | + |
| 15 | +x-general-env-variables: |
| 16 | + postgres_user: &postgres_user ${POSTGRES_USER:-default} |
| 17 | + postgres_password: &postgres_password ${POSTGRES_PASSWORD:-qwerty} |
| 18 | + # MINIO VARS |
| 19 | + minio_port: &minio_port ${MINIO_PORT:-9000} |
| 20 | + minio_console_port: &minio_console_port ${MINIO_CONSOLE_PORT:-9001} |
| 21 | + minio_root_user: &minio_root_user ${MINIO_ROOT_USER:-minioadmin} |
| 22 | + minio_root_password: &minio_root_password ${MINIO_ROOT_PASSWORD:-minioadmin} |
| 23 | + minio_services_access_key: &minio_services_access_key ${MINIO_SERVICES_ACCESS_KEY:-human-oracle} |
| 24 | + minio_services_secret_key: &minio_services_secret_key ${MINIO_SERVICES_SECRET_KEY:-human-oracle-s3-secret} |
| 25 | + # BUCKET NAMES |
| 26 | + bucket_name_manifests: &bucket_name_manifests ${BUCKET_NAME_MANIFESTS:-manifests} |
| 27 | + bucket_name_datasets: &bucket_name_datasets ${BUCKET_NAME_DATASETS:-datasets} |
| 28 | + bucket_name_rep_o: &bucket_name_rep_o ${BUCKET_NAME_REPUTATION_ORACLE:-reputation-oracle} |
| 29 | + bucket_name_fortune: &bucket_name_fortune ${BUCKEN_NAME_FORTUNE:-fortune} |
| 30 | + |
| 31 | +services: |
| 32 | + blockchain-node: |
| 33 | + container_name: hp-dev-blockchain-node |
| 34 | + image: human-protocol/hardhat-blockchain-node |
| 35 | + pull_policy: build |
| 36 | + restart: *default-restart |
| 37 | + logging: |
| 38 | + <<: *default-logging |
| 39 | + build: |
| 40 | + context: ../ |
| 41 | + dockerfile: packages/core/Dockerfile.local |
| 42 | + healthcheck: |
| 43 | + test: yarn local:readiness |
| 44 | + interval: 15s |
| 45 | + timeout: 30s |
| 46 | + retries: 0 |
| 47 | + networks: |
| 48 | + - human_protocol_web3 |
| 49 | + ports: |
| 50 | + - name: node-port |
| 51 | + target: 8545 |
| 52 | + published: ${BLOCKCHAIN_NODE_PORT:-8545} |
| 53 | + |
| 54 | + ipfs: |
| 55 | + container_name: hp-dev-ipfs |
| 56 | + image: ipfs/kubo:v0.14.0 |
| 57 | + restart: *default-restart |
| 58 | + logging: |
| 59 | + <<: *default-logging |
| 60 | + healthcheck: |
| 61 | + test: ["CMD-SHELL", "ipfs id > /dev/null"] |
| 62 | + interval: 10s |
| 63 | + timeout: 5s |
| 64 | + retries: 3 |
| 65 | + networks: |
| 66 | + - human_protocol_web3 |
| 67 | + ports: |
| 68 | + - name: ipfs-port |
| 69 | + target: 5001 |
| 70 | + published: ${IPFS_PORT:-5010} |
| 71 | + volumes: |
| 72 | + - ipfs-data:/data/ipfs:Z |
| 73 | + |
| 74 | + graph-node-db: |
| 75 | + container_name: hp-dev-graph-node-db |
| 76 | + image: postgres:latest |
| 77 | + restart: *default-restart |
| 78 | + logging: |
| 79 | + <<: *default-logging |
| 80 | + networks: |
| 81 | + - human_protocol_web3 |
| 82 | + command: |
| 83 | + [ |
| 84 | + "postgres", |
| 85 | + "-cshared_preload_libraries=pg_stat_statements", |
| 86 | + "-cmax_connections=200" |
| 87 | + ] |
| 88 | + healthcheck: |
| 89 | + test: ["CMD", "pg_isready"] |
| 90 | + interval: 10s |
| 91 | + timeout: 5s |
| 92 | + retries: 5 |
| 93 | + volumes: |
| 94 | + - graph-node-db-data:/var/lib/postgresql/data:Z |
| 95 | + environment: |
| 96 | + POSTGRES_USER: *graph_db_user |
| 97 | + POSTGRES_PASSWORD: *graph_db_passwrod |
| 98 | + POSTGRES_DB: *graph_db_name |
| 99 | + POSTGRES_INITDB_ARGS: "-E UTF8 --locale=C" |
| 100 | + |
| 101 | + graph-node: |
| 102 | + container_name: hp-dev-graph-node |
| 103 | + # In case of issues on Mac M1 rebuild the image for it locally |
| 104 | + # https://github.com/graphprotocol/graph-node/blob/master/docker/README.md#running-graph-node-on-an-macbook-m1 |
| 105 | + image: graphprotocol/graph-node |
| 106 | + restart: *default-restart |
| 107 | + logging: |
| 108 | + <<: *default-logging |
| 109 | + networks: |
| 110 | + - human_protocol_web3 |
| 111 | + ports: |
| 112 | + - '8000:8000' |
| 113 | + - '8001:8001' |
| 114 | + - '8020:8020' |
| 115 | + - '8030:8030' |
| 116 | + - '8040:8040' |
| 117 | + depends_on: |
| 118 | + - blockchain-node |
| 119 | + - ipfs |
| 120 | + - graph-node-db |
| 121 | + environment: |
| 122 | + postgres_host: graph-node-db |
| 123 | + postgres_user: *graph_db_user |
| 124 | + postgres_pass: *graph_db_passwrod |
| 125 | + postgres_db: *graph_db_name |
| 126 | + ipfs: ipfs:5001 |
| 127 | + ethereum: localhost:http://blockchain-node:8545 |
| 128 | + GRAPH_LOG: info |
| 129 | + healthcheck: |
| 130 | + test: ["CMD-SHELL", "nc -z localhost 8000 || exit 1"] |
| 131 | + interval: 5s |
| 132 | + timeout: 5s |
| 133 | + retries: 10 |
| 134 | + start_period: 10s |
| 135 | + |
| 136 | + postgres: |
| 137 | + container_name: hp-dev-postgres |
| 138 | + image: postgres:16 |
| 139 | + restart: *default-restart |
| 140 | + logging: |
| 141 | + <<: *default-logging |
| 142 | + ports: |
| 143 | + - name: instance_port |
| 144 | + target: 5432 |
| 145 | + # default 5432 is used by CVAT installation |
| 146 | + published: ${POSTGRES_PORT:-5433} |
| 147 | + volumes: |
| 148 | + - ./initdb:/docker-entrypoint-initdb.d |
| 149 | + - postgres-data:/var/lib/postgresql/data |
| 150 | + environment: |
| 151 | + POSTGRES_USER: *postgres_user |
| 152 | + POSTGRES_PASSWORD: *postgres_password |
| 153 | + healthcheck: |
| 154 | + test: ["CMD", "pg_isready"] |
| 155 | + interval: 10s |
| 156 | + timeout: 5s |
| 157 | + retries: 5 |
| 158 | + |
| 159 | + minio: |
| 160 | + container_name: hp-dev-minio |
| 161 | + image: minio/minio:RELEASE.2024-12-18T13-15-44Z |
| 162 | + restart: *default-restart |
| 163 | + logging: |
| 164 | + <<: *default-logging |
| 165 | + entrypoint: 'sh' |
| 166 | + ports: |
| 167 | + - name: instance_port |
| 168 | + target: 9000 |
| 169 | + published: *minio_port |
| 170 | + - name: console_port |
| 171 | + target: 9001 |
| 172 | + published: *minio_console_port |
| 173 | + volumes: |
| 174 | + - minio-data:/data |
| 175 | + environment: |
| 176 | + MINIO_ROOT_USER: *minio_root_user |
| 177 | + MINIO_ROOT_PASSWORD: *minio_root_password |
| 178 | + command: |
| 179 | + -c "minio server /data --console-address ':9001'" |
| 180 | + healthcheck: |
| 181 | + test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] |
| 182 | + interval: 5s |
| 183 | + timeout: 5s |
| 184 | + retries: 3 |
| 185 | + |
| 186 | + minio-client: |
| 187 | + container_name: hp-dev-minio-client |
| 188 | + image: minio/mc:RELEASE.2024-11-21T17-21-54Z |
| 189 | + depends_on: |
| 190 | + minio: |
| 191 | + condition: service_healthy |
| 192 | + environment: |
| 193 | + MINIO_ROOT_USER: *minio_root_user |
| 194 | + MINIO_ROOT_PASSWORD: *minio_root_password |
| 195 | + SERVICES_ACCESS_KEY: *minio_services_access_key |
| 196 | + SERVICES_SECRET_KEY: *minio_services_secret_key |
| 197 | + BUCKET_MANIFESTS: *bucket_name_manifests |
| 198 | + BUCKET_DATASETS: *bucket_name_datasets |
| 199 | + BUCKET_REPUTATION_ORACLE: *bucket_name_rep_o |
| 200 | + BUCKET_FORTUNE: *bucket_name_fortune |
| 201 | + entrypoint: > |
| 202 | + /bin/sh -c " |
| 203 | + mc alias set myminio http://minio:9000 $$MINIO_ROOT_USER $$MINIO_ROOT_PASSWORD |
| 204 | +
|
| 205 | + mc admin user add myminio $$SERVICES_ACCESS_KEY $$SERVICES_SECRET_KEY |
| 206 | + mc admin policy attach myminio readwrite --user=$$SERVICES_ACCESS_KEY |
| 207 | +
|
| 208 | + mc mb myminio/$$BUCKET_MANIFESTS; |
| 209 | + mc anonymous set public myminio/$$BUCKET_MANIFESTS; |
| 210 | +
|
| 211 | + mc mb myminio/$$BUCKET_DATASETS; |
| 212 | + mc anonymous set public myminio/$$BUCKET_DATASETS; |
| 213 | +
|
| 214 | + mc mb myminio/$$BUCKET_REPUTATION_ORACLE; |
| 215 | + mc anonymous set public myminio/$$BUCKET_REPUTATION_ORACLE; |
| 216 | +
|
| 217 | + mc mb myminio/$$BUCKET_FORTUNE; |
| 218 | + mc anonymous set public myminio/$$BUCKET_FORTUNE; |
| 219 | + " |
| 220 | +
|
| 221 | +volumes: |
| 222 | + ipfs-data: |
| 223 | + graph-node-db-data: |
| 224 | + postgres-data: |
| 225 | + minio-data: |
| 226 | + |
| 227 | +networks: |
| 228 | + human_protocol_web3: |
| 229 | + name: human-protocol-web3 |
0 commit comments