diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 53456a27..f45f0419 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -41,12 +41,12 @@ jobs: working-directory: frontend run: | npm install - + - name: Build frontend run: | npm run build working-directory: frontend - + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 @@ -66,8 +66,7 @@ jobs: ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }} IMAGE_TAG: latest run: | - docker buildx build --platform linux/amd64 -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f docker/Dockerfile . - docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG + docker buildx build --platform linux/amd64 -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f docker/Dockerfile . --push - name: Update Lambda function to use new Docker image env: diff --git a/docker/Dockerfile b/docker/Dockerfile index fe084f40..460fb97b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -4,6 +4,9 @@ FROM public.ecr.aws/lambda/python:3.11 WORKDIR ${LAMBDA_TASK_ROOT} +# Turns off buffering for easier container logging +ENV PYTHONUNBUFFERED 1 + # Installs the package in the container. COPY . . # RUN pip install --no-cache-dir '.[dev]' diff --git a/docker/build.sh b/docker/build.sh index aad6dbfb..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 buildx build --platform linux/amd64 -t kscale-store -f docker/Dockerfile . +docker build --platform linux/amd64 -t kscale-store -f docker/Dockerfile .