Skip to content

Commit

Permalink
🐛 fix: change order of creating requirements.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
nishide-dev committed Apr 20, 2024
1 parent f2fc4f1 commit ba6276f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions docker/lambda/lambda.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
FROM public.ecr.aws/docker/library/python:3.12.0-slim-bullseye
COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.8.1 /lambda-adapter /opt/extensions/lambda-adapter

# コピーしてrequirements.txtを作成
# requirements-dev.lockからrequirements.txtを生成
COPY requirements-dev.lock /tmp/requirements-dev.lock
RUN sed '/^-e file:.*/d' /tmp/requirements-dev.lock > requirements.txt

# アプリコードをコピーする前に依存パッケージをインストール
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt

COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.8.1 /lambda-adapter /opt/extensions/lambda-adapter
COPY . /app
WORKDIR /app

# requirements.txtをインストール
RUN pip install -r requirements.txt --no-cache-dir

CMD ["python", "src/app.py"]

0 comments on commit ba6276f

Please sign in to comment.