Skip to content

Commit c355a41

Browse files
authored
chore: modernize dependencies and container runtime (#230)
- requirements: move to Flask 2.x and drop the ancient itsdangerous==0.24 / MarkupSafe<2.1 pins that blocked installs on Python 3.10+; bump redis to 4/5, aiohttp>=3.9, lxml<6, gevent<25; add explicit Werkzeug<3 bound - Dockerfile: base image python:3.7-alpine (EOL) -> python:3.11-slim so gevent/lxml/aiohttp install from wheels instead of compiling under musl, fixing common build failures and enabling arm64 (e.g. Raspberry Pi) Refs #167, #183, #192, #178, #149, #158
1 parent 91a1983 commit c355a41

2 files changed

Lines changed: 15 additions & 16 deletions

File tree

Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
FROM python:3.7-alpine AS build
1+
FROM python:3.11-slim AS build
22
COPY requirements.txt .
3-
RUN apk update &&\
4-
apk add --no-cache gcc g++ libffi-dev openssl-dev libxml2-dev libxslt-dev build-base musl-dev &&\
3+
RUN apt-get update &&\
4+
apt-get install -y --no-install-recommends gcc g++ libxml2-dev libxslt1-dev &&\
55
pip install -U pip &&\
6-
pip install --timeout 30 --user --no-cache-dir --no-warn-script-location -r requirements.txt
6+
pip install --timeout 60 --user --no-cache-dir --no-warn-script-location -r requirements.txt &&\
7+
rm -rf /var/lib/apt/lists/*
78

8-
FROM python:3.7-alpine
9+
FROM python:3.11-slim
910
ENV APP_ENV=prod
1011
ENV LOCAL_PKG="/root/.local"
1112
COPY --from=build ${LOCAL_PKG} ${LOCAL_PKG}
12-
RUN apk update && apk add --no-cache libffi-dev openssl-dev libxslt-dev &&\
13-
ln -sf ${LOCAL_PKG}/bin/* /usr/local/bin/
13+
RUN ln -sf ${LOCAL_PKG}/bin/* /usr/local/bin/
1414
WORKDIR /app
1515
COPY . .
1616
EXPOSE 5555

requirements.txt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
environs>=9.3.0,<10.0.0
2-
Flask>=1.1.2,<2.0.0
3-
attrs>=20.3.0,<21.0.0
1+
environs>=9.3.0,<12.0.0
2+
Flask>=2.0.0,<3.0.0
3+
Werkzeug>=2.0.0,<3.0.0
4+
attrs>=20.3.0,<24.0.0
45
retrying>=1.3.3,<2.0.0
5-
aiohttp>=3.8.1,<4.0.0
6+
aiohttp>=3.9.0,<4.0.0
67
requests>=2.25.1,<3.0.0
78
loguru>=0.5.3,<1.0.0
89
pyquery>=1.4.3,<2.0.0
910
supervisor>=4.2.1,<5.0.0
10-
redis>=3.5.3,<4.0.0
11-
lxml>=4.6.5,<5.0.0
11+
redis>=4.3.0,<6.0.0
12+
lxml>=4.6.5,<6.0.0
1213
fake_headers>=1.0.2,<2.0.0
1314
maxminddb_geolite2==2018.703
14-
gevent>=21.8.0,<24.0.0
15+
gevent>=22.10.2,<25.0.0
1516
tornado>=6.0,<7.0
16-
itsdangerous==0.24
17-
MarkupSafe<2.1.0

0 commit comments

Comments
 (0)