diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..338f176 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,43 @@ +name: Deploy Docker + +on: + push: + branches: + - "master" + +jobs: + docker: + name: Create and push Docker image + runs-on: ubuntu-latest + steps: + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + # list of Docker images to use as base name for tags + images: | + lavender5/ethereum_health_checker + # generate Docker tags based on the following events/attributes + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v3 + with: + 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 45898df..aca0ae3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,10 @@ FROM python:3.12-slim WORKDIR /app +ENV POETRY_VERSION=1.7.0 \ + POETRY_VIRTUALENVS_CREATE=false \ + POETRY_HOME="/opt/poetry" + RUN pip install "poetry==$POETRY_VERSION" && poetry --version COPY pyproject.toml poetry.lock /app/ diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..4445e67 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,10 @@ +version: '3' +services: + app: + image: lavender5/ethereum_health_checker:latest + container_name: eth_health + restart: unless-stopped + env_file: + - ".env" + ports: + - "53336:53336"