diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bfb95f4cd3..082a239c3f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: IP_ADDRESS=$(curl https://ifconfig.me) echo "INFO: IP_ADDRESS=$IP_ADDRESS" - docker run -d -p 9933:9933 -p 30333:30333 -v "$(pwd)"/test-data:/data gluwa/creditcoin \ + docker run -d -p 9933:9933 -p 30333:30333 gluwa/creditcoin \ --validator --chain mainnet \ --mining-key 5DkPYq8hFiCeGxFBkz6DAwnTrvKevAJfTYrzFtr9hpDsEAU1 \ --name "test-node-$GITHUB_RUN_ID-attempt-$GITHUB_RUN_ATTEMPT" \ @@ -51,6 +51,21 @@ jobs: # this will also kill the parent container sudo killall -9 creditcoin-node + - name: Start docker-compose + run: | + docker-compose up -d + + - name: Sanity check for persistently mounted directory + run: | + sleep 60 + docker exec creditcoin-validator ls -ld /creditcoin-node/data + docker exec creditcoin-validator ls -la /creditcoin-node/data + + - name: Kill the container + run: | + # this will also kill the parent container + sudo killall -9 creditcoin-node + sanity-tests: runs-on: ubuntu-latest steps: diff --git a/Dockerfile b/Dockerfile index c49ffc60a0..6b12edb148 100644 --- a/Dockerfile +++ b/Dockerfile @@ -61,3 +61,4 @@ COPY --from=rust-builder --chown=creditcoin:creditcoin /creditcoin-node/chainspe USER 0 RUN npm install -g /creditcoin-node/scripts/cc-cli/creditcoin-cli-v*.tgz USER creditcoin +RUN mkdir /creditcoin-node/data diff --git a/docker-compose.yml b/docker-compose.yml index 0cd72dc52c..31047dc59f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,18 +1,25 @@ ---- -version: "3.2" +version: "3.7" + +volumes: + state: services: - dev: - container_name: creditcoin-node - image: paritytech/ci-linux:c4f0daf3-20220113 - working_dir: /var/www/creditcoin-node - ports: - - "9944:9944" - environment: - - CARGO_HOME=/var/www/creditcoin-node/.cargo + creditcoin: + container_name: creditcoin-validator volumes: - - .:/var/www/creditcoin-node - - type: bind - source: ./.local - target: /root/.local - command: bash -c "cargo build --release && ./target/release/creditcoin-node --dev --ws-external" + - state:/creditcoin-node/data + image: gluwa/creditcoin + command: + - --name + - validator + - --validator + - --chain + - test + - --telemetry-url + - "wss://telemetry.creditcoin.network/submit 0" + - --base-path + - /creditcoin-node/data + expose: + - 30333 + ports: + - 30333:30333