diff --git a/.dockerignore b/.dockerignore index a690443f7..356ab9dec 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,11 +3,73 @@ .gitignore .gitmodules -# Dependencies -node_modules - -# CI/CD +# GitHub .github -# Environment files -.env \ No newline at end of file +# Python +__pycache__ +*.py[cod] +*$py.class +*.so +.Python +.pytest_cache +.mypy_cache +.ruff_cache +*.egg-info +.eggs + +# Virtual environments +.venv +venv/ +ENV/ +env/ + +# IDE +.vscode +.idea +*.swp +*.swo +*~ + +# Environment files (secrets) +.env +.env.* +!.env.example + +# Logs and data +logs/ +data/ +tmp/ +temp_vision_images/ +testlogs +wandb/ + +# Test files +tests/ +*.test.py +*.spec.py + +# Documentation +*.md +!README.md + +# CI/CD +*.yml +!package.json + +# Development files +examples/ +result +.direnv/ + +# Release scripts +.release_notes.md +mini-swe-agent/ + +# Nix +.direnv/ +result + +# Skills hub +skills/.hub/ +ignored/ diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 11b98c3a9..1f83913b2 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -5,6 +5,8 @@ on: branches: [main] pull_request: branches: [main] + release: + types: [published] concurrency: group: docker-${{ github.ref }} @@ -41,13 +43,13 @@ jobs: nousresearch/hermes-agent:test --help - name: Log in to Docker Hub - if: github.event_name == 'push' && github.ref == 'refs/heads/main' + if: github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'release' uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Push image + - name: Push image (main branch) if: github.event_name == 'push' && github.ref == 'refs/heads/main' uses: docker/build-push-action@v6 with: @@ -59,3 +61,17 @@ jobs: nousresearch/hermes-agent:${{ github.sha }} cache-from: type=gha cache-to: type=gha,mode=max + + - name: Push image (release) + if: github.event_name == 'release' + uses: docker/build-push-action@v6 + with: + context: . + file: Dockerfile + push: true + tags: | + nousresearch/hermes-agent:latest + nousresearch/hermes-agent:${{ github.event.release.tag_name }} + nousresearch/hermes-agent:${{ github.sha }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/Dockerfile b/Dockerfile index 61b725d39..0ffe0fc2f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,25 @@ FROM debian:13.4 -RUN apt-get update -RUN apt-get install -y nodejs npm python3 python3-pip ripgrep ffmpeg gcc python3-dev libffi-dev +# Install system dependencies in one layer, clear APT cache +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + nodejs npm python3 python3-pip ripgrep ffmpeg gcc python3-dev libffi-dev && \ + rm -rf /var/lib/apt/lists/* COPY . /opt/hermes WORKDIR /opt/hermes -RUN pip install -e ".[all]" --break-system-packages -RUN npm install -RUN npx playwright install --with-deps chromium +# Install Python and Node dependencies in one layer, no cache +RUN pip install --no-cache-dir -e ".[all]" --break-system-packages && \ + npm install --prefer-offline --no-audit && \ + npx playwright install --with-deps chromium + WORKDIR /opt/hermes/scripts/whatsapp-bridge -RUN npm install +RUN npm install --prefer-offline --no-audit WORKDIR /opt/hermes RUN chmod +x /opt/hermes/docker/entrypoint.sh ENV HERMES_HOME=/opt/data VOLUME [ "/opt/data" ] -ENTRYPOINT [ "/opt/hermes/docker/entrypoint.sh" ] \ No newline at end of file +ENTRYPOINT [ "/opt/hermes/docker/entrypoint.sh" ]