-
Notifications
You must be signed in to change notification settings - Fork 26
/
Dockerfile
70 lines (48 loc) · 2.25 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
FROM python:3.13.0-alpine@sha256:fcbcbbecdeae71d3b77445d9144d1914df55110f825ab62b04a66c7c33c09373 AS builder
# Prevent Python from writing out pyc files
ENV PYTHONDONTWRITEBYTECODE=1
# Keep Python from buffering stdin/stdout
ENV PYTHONUNBUFFERED=1
# Enable custom virtual environment
ENV VIRTUAL_ENV=/opt/venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# renovate: datasource=pypi depName=pip versioning=pep440
ARG PIP_VERSION="24.3.1"
# Set the working directory
WORKDIR /app
# Add requirements file
COPY requirements.txt .
# Install requirements
RUN python3 -m venv ${VIRTUAL_ENV} && \
pip install --no-cache-dir --upgrade pip=="${PIP_VERSION}" && \
pip install --no-cache-dir -r requirements.txt
FROM python:3.13.0-alpine@sha256:fcbcbbecdeae71d3b77445d9144d1914df55110f825ab62b04a66c7c33c09373
# renovate: datasource=pypi depName=pip versioning=pep440
ARG PIP_VERSION="24.3.1"
# renovate: datasource=repology depName=alpine_3_20/firefox versioning=loose
ARG FIREFOX_VERSION="132.0.2-r0"
# renovate: datasource=repology depName=alpine_3_20/font-noto versioning=loose
ARG FONT_MOTO_VERSION="23.7.1-r0"
# renovate: datasource=repology depName=alpine_edge/geckodriver versioning=loose
ARG GECKODRIVER_VERSION="0.35.0-r0"
# renovate: datasource=repology depName=alpine_3_20/openssl versioning=loose
ARG OPENSSL_VERSION="3.3.2-r1"
# renovate: datasource=repology depName=alpine_3_20/expat versioning=loose
ARG EXPAT_VERSION="2.6.4-r0"
RUN apk add --no-cache firefox="${FIREFOX_VERSION}" font-noto=="${FONT_MOTO_VERSION}" && \
apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community geckodriver="${GECKODRIVER_VERSION}" && \
ln -s /usr/bin/geckodriver /usr/local/bin/geckodriver && \
rm -rf /var/cache/apk/* /tmp/*
# Fix vulnerabilities reported by Trivy
RUN apk add --no-cache libcrypto3="${OPENSSL_VERSION}" libssl3="${OPENSSL_VERSION}" libexpat="${EXPAT_VERSION}" && \
/usr/local/bin/pip install --upgrade pip=="${PIP_VERSION}"
# Enable custom virtual environment
ENV VIRTUAL_ENV=/opt/venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# Copy dependencies from previous stage
COPY --from=builder $VIRTUAL_ENV $VIRTUAL_ENV
# Set the working directory
WORKDIR /app
# Copy and set the entrypoint bash script
COPY renew.py .
ENTRYPOINT ["python3", "renew.py"]