-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
48 lines (41 loc) · 1.21 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Pull the base image with python 3.8 as a runtime for your Lambda
FROM public.ecr.aws/lambda/python:3.8
# Install OS packages for Pillow-SIMD
RUN yum -y install tar gzip zlib freetype-devel \
gcc \
ghostscript \
lcms2-devel \
libffi-devel \
libimagequant-devel \
libjpeg-devel \
libraqm-devel \
libtiff-devel \
libwebp-devel \
make \
openjpeg2-devel \
rh-python36 \
rh-python36-python-virtualenv \
sudo \
tcl-devel \
tk-devel \
tkinter \
which \
xorg-x11-server-Xvfb \
zlib-devel \
&& yum clean all
# Copy the earlier created requirements.txt file to the container
COPY requirements.txt ./
COPY deer.jpg ./
COPY md_v4.1.0.pb ./
# Install the python requirements from requirements.txt
RUN python3.8 -m pip install -r requirements.txt
# Replace Pillow with Pillow-SIMD to take advantage of AVX2
RUN pip uninstall -y pillow && CC="cc -mavx2" pip install -U --force-reinstall pillow-simd
# Copy the earlier created app.py file to the container
COPY app.py ./
# Bring in cameratraps libs
COPY CameraTraps/ /CameraTraps
COPY ai4eutils/ /ai4eutils
ENV PYTHONPATH "${PYTHONPATH}:/CameraTraps:/ai4eutils"
# Set the CMD to your handler
CMD ["app.lambda_handler"]