diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 87ebb61..75437cf 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -12,6 +12,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: They are the same. + run: sudo ln -sf /usr/libexec/docker/cli-plugins/docker-compose /usr/bin/docker-compose - name: Building HXL Proxy image run: docker-compose -f docker-compose-github-actions.yml build proxy - name: Spinning up container diff --git a/CHANGELOG b/CHANGELOG index d687830..60565c7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +2024-08-21 Release 2.2.3: + - update docker base image + - remove legacy deps specifiers + 2024-06-06 Release 2.2.2: - add Google Tab Manager js lib - ability to configure GTM via env var GOOGLE_TAG_MANAGER_ID diff --git a/Dockerfile b/Dockerfile index 7e70f7f..bc6349b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,34 +1,49 @@ -FROM public.ecr.aws/unocha/python:3.9 +FROM public.ecr.aws/unocha/python:3.9-stable + +ARG UNITD_VERSION=1.32.1-1 WORKDIR /srv/www COPY . . -RUN apk add \ - git \ - libffi-dev \ - unit \ - unit-python3 && \ +# when we use the same python as the latest alpine distro, sure +#unit \ +#unit-python3 && \ + +RUN apk add --no-cache --upgrade --virtual .build-deps \ + build-base \ + git \ + libffi-dev \ + pcre-dev && \ mkdir -p \ - /etc/services.d/hxl \ - /srv/cache \ - /srv/config \ - /srv/output \ - /var/log/proxy && \ + /etc/services.d/hxl \ + /srv/cache \ + /srv/config \ + /srv/output \ + /var/log/proxy && \ mv config.py.TEMPLATE /srv/config/config.py && \ mv docker_files/hxl_run /etc/services.d/hxl/run && \ mv docker_files/app.py docker_files/app_nr.py docker_files/app_elastic.py . && \ pip3 --no-cache-dir install --upgrade \ - pip \ - wheel && \ + pip \ + wheel && \ pip3 install --upgrade -r requirements.txt && \ pip3 install \ - elastic-apm[flask] \ - newrelic && \ - apk del \ - git \ - libffi-dev && \ + elastic-apm[flask] && \ + cd /tmp && \ + git clone https://github.com/nginx/unit && \ + cd /tmp/unit && \ + git checkout ${UNITD_VERSION} && \ + ./configure && make && make install && \ + ./configure python && make python && make python-install && \ + apk del .build-deps && \ + apk add pcre && \ + addgroup unit -g 101 && \ + adduser -D -H unit -u 100 -G unit && \ + mkdir -p /var/lib/unit/ && \ rm -rf /root/.cache && \ rm -rf /var/cache/apk/* EXPOSE 5000 + +ENTRYPOINT [ "/init" ] diff --git a/docker_files/hxl_run b/docker_files/hxl_run index 47a00f9..e9f0cca 100644 --- a/docker_files/hxl_run +++ b/docker_files/hxl_run @@ -29,4 +29,4 @@ fi chmod 600 /var/lib/unit/conf.json chown unit /var/log/proxy -exec unitd --no-daemon --control 127.0.0.1:8080 --log /var/log/proxy/proxy.log +exec unitd --user unit --group unit --statedir /var/lib/unit --no-daemon --control 127.0.0.1:8080 --log /var/log/proxy/proxy.log diff --git a/hxl_proxy/__init__.py b/hxl_proxy/__init__.py index a573967..7548e42 100644 --- a/hxl_proxy/__init__.py +++ b/hxl_proxy/__init__.py @@ -8,7 +8,7 @@ """ -__version__="2.2.2" +__version__="2.2.3" """Module version number See https://www.python.org/dev/peps/pep-0396/ diff --git a/requirements.txt b/requirements.txt index 3b2dfda..ecd27ed 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ urllib3<1.27,>1.21.1 # avoid caching bug requests_cache ckanapi>=3.5 -flask>=2.2.5<2.3 # 2.3 messes up pip dependencies +flask==3.0.3 #git+https://github.com/HXLStandard/libhxl-python.git@dev#egg=libhxl # for development libhxl==5.2.1 # for release flask-caching