From 1ea647b14791609629169efbf9b0325b0bd02233 Mon Sep 17 00:00:00 2001 From: Stan Girard Date: Tue, 5 Dec 2023 00:01:14 +0100 Subject: [PATCH] feat(prebuilt): prebuild backend image for faster compilation (#1815) # Description Please include a summary of the changes and the related issue. Please also include relevant motivation and context. ## Checklist before requesting a review Please delete options that are not relevant. - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented hard-to-understand areas - [ ] I have ideally added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged ## Screenshots (if appropriate): --- .github/workflows/aws-preview.yml | 7 ++++++- docker-compose.yml | 17 +++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/aws-preview.yml b/.github/workflows/aws-preview.yml index 11226e8c7..ddf5dd879 100644 --- a/.github/workflows/aws-preview.yml +++ b/.github/workflows/aws-preview.yml @@ -39,6 +39,11 @@ jobs: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 @@ -58,7 +63,7 @@ jobs: with: context: ./backend/ push: true - tags: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}, ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest, ghcr.io/stangirard/quivr:latest + tags: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}, ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest, ghcr.io/stangirard/quivr:latest, stangirard/quivr-backend-prebuilt:latest, stangirard/quivr-backend-prebuilt:${{ env.IMAGE_TAG }} cache-from: type=gha cache-to: type=gha,mode=max diff --git a/docker-compose.yml b/docker-compose.yml index f5ea85a87..870637e5f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,6 +2,7 @@ version: "3.8" services: frontend: + image: quivr-frontend-prebuilt pull_policy: never build: context: frontend @@ -22,8 +23,8 @@ services: backend-core: - image: backend-base - pull_policy: never + image: stangirard/quivr-backend-prebuilt:latest + pull_policy: if_not_present env_file: - .env build: @@ -64,8 +65,8 @@ services: condition: service_healthy worker: - pull_policy: never - image: backend-base + pull_policy: if_not_present + image: stangirard/quivr-backend-prebuilt:latest env_file: - .env build: @@ -79,8 +80,8 @@ services: - db beat: - image: backend-base - pull_policy: never + image: stangirard/quivr-backend-prebuilt:latest + pull_policy: if_not_present env_file: - .env build: @@ -93,8 +94,8 @@ services: - redis flower: - image: backend-base - pull_policy: never + image: stangirard/quivr-backend-prebuilt:latest + pull_policy: if_not_present env_file: - .env build: