diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b2d2b662..8630a2db 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -66,7 +66,7 @@ jobs: ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }} IMAGE_TAG: latest run: | - docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f docker/Dockerfile . + docker build --platform linux/amd64 -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f docker/Dockerfile . docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG - name: Update Lambda function to use new Docker image diff --git a/docker/Dockerfile b/docker/Dockerfile index 6da132d5..cea8944e 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,10 +2,8 @@ FROM public.ecr.aws/lambda/python:3.11 -WORKDIR /app - # Installs the package in the container. -ADD . /app +ADD . ${LAMBDA_TASK_ROOT} RUN pip install --no-cache-dir . # Runs the application. diff --git a/docker/build.sh b/docker/build.sh index 14f9e0da..6475ecd1 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -12,4 +12,4 @@ if [[ ! -f "store/requirements.txt" ]]; then fi # Builds the API Docker image. -docker build -t kscale-store -f docker/Dockerfile . +docker build --platform linux/amd64 -t kscale-store -f docker/Dockerfile .