I am following the example from https://www.serverless.com/blog/container-support-for-lambda/ and I have a question.
My original lambda handler has 2 functions within the handler.js. In the original serverless.yml without docker image, I have:
functions:
func1:
handler: handler.func1
events:
...
func2:
handler: handler.func2
events:
...
The new serverless.yml, I am changing it to:
functions:
func1:
image: <account>.dkr.ecr.<region>.amazonaws.com/<repository>@<digest>
events:
...
func2:
image: <account>.dkr.ecr.<region>.amazonaws.com/<repository>@<digest>
events:
...
My question is, what do I put into the CMD in the Dockerfile so I can access both func1 and func2?
Currently I have:
FROM public.ecr.aws/lambda/nodejs:14
ARG FUNCTION_DIR="/var/task"
# Create function directory
RUN mkdir -p ${FUNCTION_DIR}
# Copy handler function and package.json
COPY handler.js ${FUNCTION_DIR}
COPY package.json ${FUNCTION_DIR}
# Install NPM dependencies for function
RUN npm install
# Set the CMD to your handler
CMD [ "handler" ]