-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (24 loc) · 844 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM node:20
# Create llamafile files
RUN mkdir -p /opt/llamafile
COPY ./tmp/llamafile/* /opt/llamafile
COPY src/command /opt/llamafile/
# Install packages to support llamafile and other required tools
RUN apt-get update && \
apt-get install -y findutils gzip && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN wget -O /usr/bin/ape https://cosmo.zip/pub/cosmos/bin/ape-$(uname -m).elf && \
chmod +x /usr/bin/ape
# Lambda Web Adapter
COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.8.3 /lambda-adapter /opt/extensions/lambda-adapter
ENV AWS_LWA_INVOKE_MODE=response_stream
ENV AWS_LWA_ASYNC_INIT=true
ENV AWS_LWA_READINESS_CHECK_PATH=/health
RUN mkdir -p /var/task
WORKDIR "/var/task"
COPY src/app.js \
package.json \
package-lock.json .
# Start llamafile and no-op handler.
CMD [ "node", "app.js" ]