Skip to content

Commit 18e1401

Browse files
committed
fix aws lambda zip deploy
1 parent 23c29f1 commit 18e1401

2 files changed

Lines changed: 4 additions & 15 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Thumbs.db
2727

2828
# Deployment artifacts
2929
deployment/lambda_package.zip
30+
package/*
3031

3132
# Terraform
3233
terraform/.terraform/

deployment/build_lambda.sh

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,9 @@ echo "Building Lambda package..."
1212
rm -rf "$BUILD_DIR"
1313
mkdir -p "$BUILD_DIR"
1414

15-
# Check if Docker is available for cross-platform build
16-
if command -v docker &> /dev/null; then
17-
echo "Using Docker for cross-platform build (Amazon Linux 2023)..."
18-
19-
# Install dependencies using Lambda Python image
20-
docker run --rm \
21-
--entrypoint "" \
22-
-v "$PROJECT_ROOT:/var/task" \
23-
-v "$BUILD_DIR:/var/build" \
24-
public.ecr.aws/lambda/python:3.12 \
25-
pip install -r /var/task/requirements-aws.txt -t /var/build --quiet --upgrade
26-
else
27-
echo "Docker not found, using local pip (may not work on Lambda)..."
28-
pip3 install -r "$PROJECT_ROOT/requirements-aws.txt" -t "$BUILD_DIR" --quiet --upgrade
29-
fi
15+
# Install dependencies
16+
echo "Installing Python dependencies..."
17+
pip3 install -r "$PROJECT_ROOT/requirements-aws.txt" -t package/ --quiet
3018

3119
# Copy application code
3220
echo "Copying application code..."

0 commit comments

Comments
 (0)