Skip to content

Fix deploy workflow failure from Docker daemon permission denial on EC2 - #20

Draft
Dinurang with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-failing-github-actions-job
Draft

Fix deploy workflow failure from Docker daemon permission denial on EC2#20
Dinurang with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-failing-github-actions-job

Conversation

Copilot AI commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

The deploy GitHub Actions job was failing in the remote SSH step because Docker Compose commands were executed without Docker daemon access on the EC2 host. This change updates the workflow so deploy commands run with appropriate privileges and tightens workflow token permissions.

  • Deploy step privilege correction

    • Switched remote Docker Compose invocations to sudo in .github/workflows/deploy.yml so the SSH user can access /var/run/docker.sock.
    • Applied to build, startup, status, and backend log collection paths.
  • Workflow token hardening

    • Added explicit workflow permissions:
      • contents: read
    • Reduces default token scope and satisfies Actions security checks.
permissions:
  contents: read

# inside remote SSH deploy script
sudo docker compose build
sudo docker compose up -d
sudo docker compose ps
# on health-check failure
sudo docker compose logs --tail 200 backend

Copilot AI and others added 2 commits August 29, 2026 04:32
Co-authored-by: Dinurang <172159221+Dinurang@users.noreply.github.com>
Co-authored-by: Dinurang <172159221+Dinurang@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job deploy Fix deploy workflow failure from Docker daemon permission denial on EC2 Aug 29, 2026
Copilot AI requested a review from Dinurang August 29, 2026 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants