Skip to content

Commit

Permalink
Merge pull request #75 from rhettre/feature/release-workflow
Browse files Browse the repository at this point in the history
Update Dockerfile
  • Loading branch information
rhettre committed Jul 27, 2024
2 parents 2ed783f + 99b6be9 commit 687be83
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ FROM public.ecr.aws/lambda/python:3.9
# Set up the work directory
WORKDIR /var/task

# Install necessary build tools
RUN yum install -y zip gcc python3-devel

# Copy your application code and requirements.txt into the Docker image
COPY . .

# Install dependencies and create the layer
RUN yum install -y zip && \
pip install --upgrade pip setuptools wheel && \
RUN pip install --upgrade pip setuptools wheel && \
pip install -r requirements.txt && \
pip install . && \
mkdir -p /tmp/python && \
Expand All @@ -19,9 +21,11 @@ RUN yum install -y zip && \
--python-version 3.9 \
--only-binary=:all: --upgrade \
-r requirements.txt -t /tmp/python && \
pip install cffi --no-binary :all: -t /tmp/python && \
pip install . -t /tmp/python && \
cd /tmp/python && \
zip -r9 /tmp/layer.zip . -x '*.pyc' '*.pyo' && \
find . -type d -name "__pycache__" -exec rm -rf {} + && \
zip -r9 /tmp/layer.zip . && \
cd /var/task

# Copy the layer.zip to a known location
Expand Down

0 comments on commit 687be83

Please sign in to comment.