From 6ef5a9b192af772fba4488e0bfefad4d41da519c Mon Sep 17 00:00:00 2001 From: sharath <29162020+tnfssc@users.noreply.github.com> Date: Sun, 25 May 2025 16:50:21 +0000 Subject: [PATCH] chore(docker): remove frontend image build step from CI workflow and expose port 8000 in backend Dockerfile --- .github/workflows/docker-build.yml | 34 +++++++++++++++++------------- backend/Dockerfile | 2 ++ 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 49c94a9b..87d05b02 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -1,9 +1,10 @@ -name: Build and Push Docker Images +name: Build and Push Docker Image on: - # Remove active triggers to disable the workflow - # push: - # branches: [ main ] + push: + branches: + - main + - PRODUCTION workflow_dispatch: permissions: @@ -16,6 +17,18 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Get tag name + shell: bash + run: | + if [[ "${GITHUB_REF#refs/heads/}" == "main" ]]; then + echo "branch=latest" >> $GITHUB_OUTPUT + elif [[ "${GITHUB_REF#refs/heads/}" == "PRODUCTION" ]]; then + echo "branch=prod" >> $GITHUB_OUTPUT + else + echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + fi + id: get_tag_name + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -32,16 +45,7 @@ jobs: context: ./backend file: ./backend/Dockerfile push: true - tags: ghcr.io/${{ github.repository }}/suna-backend:latest + platforms: linux/arm64, linux/amd64 + tags: ghcr.io/${{ github.repository }}/suna-backend:${{ steps.get_tag_name.outputs.branch }} cache-from: type=gha cache-to: type=gha,mode=max - - - name: Build and push Frontend image - uses: docker/build-push-action@v5 - with: - context: ./frontend - file: ./frontend/Dockerfile - push: true - tags: ghcr.io/${{ github.repository }}/suna-frontend:latest - cache-from: type=gha - cache-to: type=gha,mode=max \ No newline at end of file diff --git a/backend/Dockerfile b/backend/Dockerfile index 8e53bdc2..28e0bcfe 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -38,6 +38,8 @@ ENV WORKERS=33 ENV THREADS=2 ENV WORKER_CONNECTIONS=2000 +EXPOSE 8000 + # Gunicorn configuration CMD ["sh", "-c", "gunicorn api:app \ --workers $WORKERS \