-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (35 loc) · 1.06 KB
/
Dockerfile
File metadata and controls
51 lines (35 loc) · 1.06 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# syntax=docker/dockerfile:1
ARG TARGETPLATFORM=linux/arm64
FROM public.ecr.aws/lambda/python:3.11 AS tests
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
WORKDIR /var/task
RUN yum install -y gcc gcc-c++ \
&& yum clean all \
&& rm -rf /var/cache/yum
RUN python -m pip install --no-cache-dir --upgrade pip
COPY pyproject.toml README.md ./
COPY app ./app
COPY entrypoint.sh ./
COPY tests ./tests
RUN python -m pip install --no-cache-dir ".[dev]"
RUN coverage run -m pytest \
&& coverage xml
FROM public.ecr.aws/lambda/python:3.11
ARG BUILD_TIME
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
BUILD_TIME=${BUILD_TIME}
WORKDIR /var/task
RUN yum install -y gcc gcc-c++ \
&& yum clean all \
&& rm -rf /var/cache/yum
COPY pyproject.toml README.md ./
COPY app ./app
COPY entrypoint.sh ./
RUN python -m pip install --no-cache-dir --upgrade pip \
&& python -m pip install --no-cache-dir .
RUN echo "${BUILD_TIME:-unknown}" > /var/task/.build_time
RUN chmod +x entrypoint.sh
ENTRYPOINT ["./entrypoint.sh"]
CMD ["app.main.handler"]