-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (18 loc) · 698 Bytes
/
Dockerfile
File metadata and controls
28 lines (18 loc) · 698 Bytes
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
FROM ghcr.io/cargo-lambda/cargo-lambda:1.1.0 as cargo-lambda-user
RUN groupadd -r -g 1000 appuser
RUN useradd -r -u 1000 -g appuser appuser
USER 1000:1000
FROM cargo-lambda-user as meal-planner-api-development
WORKDIR /usr/src/app
COPY . .
EXPOSE 8080
CMD [ "cargo", "lambda", "watch", "-a", "0.0.0.0", "-p", "8080"]
FROM meal-planner-api-development as meal-planner-api-build
USER 0
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=./target \
cargo lambda build -r -l /tmp
FROM public.ecr.aws/lambda/provided:al2023 as meal-planner-api
WORKDIR /opt
COPY --from=meal-planner-api-build /tmp/lambda/bootstrap ${LAMBDA_RUNTIME_DIR}
CMD [ "bootstrap" ]