diff --git a/.github/workflows/docker-build-dev.yml b/.github/workflows/docker-build-dev.yml new file mode 100644 index 0000000..48b6768 --- /dev/null +++ b/.github/workflows/docker-build-dev.yml @@ -0,0 +1,31 @@ +name: build docker image dev +on: + push: + branches: + - main + tags-ignore: + - v* + paths-ignore: + - 'docs/**' + - '.github/**' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Docker build and push + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: deltampc/delta-chain:dev \ No newline at end of file diff --git a/.github/workflows/docker-build-release.yml b/.github/workflows/docker-build-release.yml new file mode 100644 index 0000000..b2abbe6 --- /dev/null +++ b/.github/workflows/docker-build-release.yml @@ -0,0 +1,34 @@ +name: build docker image release +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + images: deltampc/delta-chain + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + - name: Docker build and push + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index f889e0d..3244a20 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,8 +8,7 @@ WORKDIR /delta COPY --from=builder /delta/target/release/delta-chain-node ./node # Shrinking -RUN rm -rf /usr/lib/python* && \ - rm -rf /usr/bin /usr/sbin /usr/share/man +RUN rm -rf /usr/lib/python* # 30333 for p2p traffic # 9933 for RPC call diff --git a/docker-compose.yml b/docker-compose.yml index 6299859..1dbca2e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: alice: build: . container_name: delta-chain-alice - image: deltampc/delta-chain:0.0.1 + image: deltampc/delta-chain:dev command: - --validator - --unsafe-ws-external @@ -13,8 +13,8 @@ services: - Unsafe - --name - Alice - - --node-key - - $AliceNodeKey + - --node-key-file + - /root/.local/node-key ports: - "9944:9944" - "9933:9933" @@ -24,7 +24,7 @@ services: target: /root/.local bob: container_name: delta-chain-bob - image: deltampc/delta-chain:0.0.1 + image: deltampc/delta-chain:dev command: - --validator - --unsafe-ws-external @@ -39,8 +39,8 @@ services: - "9945" - --rpc-port - "9934" - - --node-key - - $BobNodeKey + - --node-key-file + - /root/.local/node-key - --bootnodes - /dns/alice/tcp/30333/p2p/12D3KooWKpxeRfkRPmCQUb9PCBVPgdo139n3g8SNAKE3Ap4V6bWy ports: