Skip to content

Commit

Permalink
Merge pull request #64 from rhettre/feature/release-workflow
Browse files Browse the repository at this point in the history
Update Dockerfile
  • Loading branch information
rhettre authored Jul 27, 2024
2 parents 59c96ec + 236b673 commit 72124f8
Showing 1 changed file with 8 additions and 20 deletions.
28 changes: 8 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,18 @@ WORKDIR /root
# Copy your application code and requirements.txt into the Docker image
COPY . .

# Create a virtual environment and install dependencies
RUN python3.9 -m venv /root/venv && \
. /root/venv/bin/activate && \
pip install --upgrade pip && \
pip install \
# Install dependencies directly into the Lambda-compatible directory structure
RUN mkdir -p python/lib/python3.9/site-packages && \
python3.9 -m pip install --upgrade pip && \
python3.9 -m pip install \
--platform manylinux2014_x86_64 \
--implementation cp \
--python-version 3.9 \
--only-binary=:all: --upgrade \
-r requirements.txt && \
pip install . && \
deactivate
-r requirements.txt -t python/lib/python3.9/site-packages && \
python3.9 -m pip install . -t python/lib/python3.9/site-packages

# Package everything into a ZIP file
CMD . /root/venv/bin/activate && \
mkdir -p python/lib/python3.9/site-packages && \
pip install \
--platform manylinux2014_x86_64 \
--implementation cp \
--python-version 3.9 \
--only-binary=:all: --upgrade \
-r requirements.txt -t python/lib/python3.9/site-packages && \
pip install . -t python/lib/python3.9/site-packages && \
cd python && \
CMD cd python && \
zip -r ../layer.zip . && \
cd .. && \
deactivate
cd ..

0 comments on commit 72124f8

Please sign in to comment.