diff --git a/.github/workflows/build-pre-baked-images.yml b/.github/workflows/build-pre-baked-images.yml new file mode 100644 index 00000000..1394b54a --- /dev/null +++ b/.github/workflows/build-pre-baked-images.yml @@ -0,0 +1,51 @@ +name: Build pre-baked images + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +jobs: + push_to_registry: + name: Push Docker Image to GitHub Packages + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + env: + DOCKER_METADATA_PR_HEAD_SHA: true + outputs: + digest: ${{ steps.push.outputs.digest }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Log in to the container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/xmtp/anvil-xmtpd + tags: | + type=schedule + type=ref,event=branch + type=ref,event=tag + type=ref,event=pr + type=sha + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + id: push + with: + context: . + file: ./dev/baked/Dockerfile + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/dev/baked/Dockerfile b/dev/baked/Dockerfile index 804ade52..5614a752 100644 --- a/dev/baked/Dockerfile +++ b/dev/baked/Dockerfile @@ -24,18 +24,14 @@ RUN dev/docker/anvil-background && \ # ACTUAL IMAGE ------------------------------------------------------- -FROM debian:bookworm +FROM ghcr.io/foundry-rs/foundry LABEL maintainer="engineering@xmtp.com" LABEL source="https://github.com/xmtp/xmtpd" -LABEL description="XMTP Node Software" +LABEL description="Foundry with XMTPD Node contracts and registrations" -# color, nocolor, json -ENV GOLOG_LOG_FMT=nocolor +EXPOSE 8545 -EXPOSE 5050 - -COPY --from=builder /usr/local/bin/anvil /usr/bin/ COPY --from=builder /app/anvil-baked-state anvil-baked-state -CMD ["anvil", "--state", "anvil-baked-state"] \ No newline at end of file +CMD ["anvil", "--state", "anvil-baked-state", "--host", "0.0.0.0"] \ No newline at end of file