Lambda Container Dockerfile 작성예시

<Cloud>/AWS|2021. 8. 25. 11:04
반응형
# python3.8 lambda base image
FROM public.ecr.aws/lambda/python:3.8

# copy requirements.txt to container
# 설치할 패키지들을 requirements.txt 에 기재
COPY requirements.txt ./   

# installing dependencies
RUN pip3 install --upgrade --ignore-installed pip setuptools
RUN pip3 install -r requirements.txt
RUN yum install git -y

# Copy function code to container
COPY feature_info.py ./   # host 에서 Container 로 file copy
COPY app.py ./            # host 에서 Container 로 file copy
RUN git clone https://github.com/ ~~~  # 사용할 파일들 불러오기

# setting the CMD to your handler file_name.function_name
CMD [ "app.lambda_handler" ]  # app.py 에서 handler 함수를 시작하도록 세팅

 

 

https://gallery.ecr.aws/

 

ECR Public Gallery

Amazon ECR Public Gallery is a website that allows anyone to browse and search for public container images, view developer-provided details, and see pull commands

gallery.ecr.aws

ㄴ람다 베이스 이미지는 여기서 불러와 서 사용할수 있다.

 

 

반응형

'<Cloud> > AWS' 카테고리의 다른 글

Lambda, API Gateway, AJAX 주거니 받거니  (0) 2021.08.31
서버리스 활용 1)EFS , 2)ECR  (0) 2021.08.31
Lambda Container 파일 접근 위치 + 파일 형식  (0) 2021.08.25
Lambda Container 연습  (0) 2021.08.25
EC2 user data 에 start.sh  (0) 2021.05.09

댓글()