-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.main
61 lines (53 loc) · 2.06 KB
/
Dockerfile.main
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
52
53
54
55
56
57
58
59
60
61
FROM public.ecr.aws/lambda/python:3.12.2024.10.30.16-x86_64 AS build
RUN dnf install -y unzip && \
curl -Lo "/tmp/chromedriver-linux64.zip" "https://storage.googleapis.com/chrome-for-testing-public/130.0.6723.91/linux64/chromedriver-linux64.zip" && \
curl -Lo "/tmp/chrome-linux64.zip" "https://storage.googleapis.com/chrome-for-testing-public/130.0.6723.91/linux64/chrome-linux64.zip" && \
unzip /tmp/chromedriver-linux64.zip -d /opt/ && \
unzip /tmp/chrome-linux64.zip -d /opt/
FROM public.ecr.aws/lambda/python:3.12.2024.10.30.16-x86_64
ARG TOURIST_VERSION
ARG CREATED
ARG REVISION
LABEL org.opencontainers.image.title="Tourist"
LABEL org.opencontainers.image.description="An open-source, serverless application for web scraping."
LABEL org.opencontainers.image.version=$TOURIST_VERSION
LABEL org.opencontainers.image.authors="pogzyb@umich.edu"
LABEL org.opencontainers.image.url="https://github.com/pogzyb/tourist"
LABEL org.opencontainers.image.source="https://github.com/pogzyb/tourist"
LABEL org.opencontainers.image.documentation="https://github.com/pogzyb/tourist"
LABEL org.opencontainers.image.created=$CREATED
LABEL org.opencontainers.image.revision=$REVISION
LABEL org.opencontainers.image.licenses="MIT"
RUN dnf install -y \
atk \
cups-libs \
gtk3 \
libXcomposite \
alsa-lib \
libXcursor \
libXdamage \
libXext \
libXi \
libXrandr \
libXScrnSaver \
libXtst \
pango \
at-spi2-atk \
libXt \
xorg-x11-server-Xvfb \
xorg-x11-xauth \
dbus-glib \
dbus-glib-devel \
nss \
mesa-libgbm \
&& dnf clean all \
&& rm -rf /var/cache/yum && \
pip install --no-cache-dir tourist[app]==$TOURIST_VERSION
COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.8.4 /lambda-adapter /opt/extensions/lambda-adapter
COPY --from=build /opt/chrome-linux64 /tourist/browser
COPY --from=build /opt/chromedriver-linux64 /tourist/browser
ENV AWS_LWA_READINESS_CHECK_PATH=/info/readiness-check
ENV AWS_LWA_REMOVE_BASE_PATH=/main
ENV AWS_LWA_ENABLE_COMPRESSION=true
ENV AWS_LWA_PORT=8000
ENTRYPOINT [ "tourist" ]