Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.git
.github
.vscode
.idea

.env
.env.*

out
cache

node_modules
30 changes: 28 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,28 @@
PRIVATE_KEY=
RPC_URL=http://127.0.0.1:8545
# =========================
# Anvil Configuration
# =========================

ANVIL_PORT=8545
ANVIL_CHAIN_ID=31337
ANVIL_ACCOUNTS=10
ANVIL_BALANCE=10000

# Development only - DO NOT use in production
ANVIL_MNEMONIC=test test test test test test test test test test test junk

# =========================
# NettedX Deployment
# =========================

RPC_URL=http://anvil:8545

# Private key of Anvil account #0
# Development only
DEPLOYER_PRIVATE_KEY=0x...

# =========================
# Docker
# =========================

ANVIL_CONTAINER_NAME=nettedx-anvil
DEPLOYER_CONTAINER_NAME=nettedx-deployer
55 changes: 55 additions & 0 deletions .github/workflows/Docker-Build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Docker Build

on:
release:
types: [published]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
docker:
name: Build and Push Docker Image
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
13 changes: 13 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.patterns": {
".gitignore": ".gitattributes, .gitmodules, .gitkeep",
".env": ".env.*",
"foundry.toml": "foundry.*, remappings.txt",
"Dockerfile": "docker-compose.yml, docker-compose.override.yml, docker-compose.*.yml, .dockerignore"
},
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"editor.formatOnSave": true,
}
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM ghcr.io/foundry-rs/foundry:v1.7.1

WORKDIR /app

COPY . .

RUN git config --global --add safe.directory /app

RUN forge build
RUN forge test

CMD ["forge", "build"]
Loading
Loading