Skip to content

Commit

Permalink
Merge pull request #489 from HXLStandard/hdx-10073
Browse files Browse the repository at this point in the history
[HDX-10073] update base image and remove legacy deps specifiers
  • Loading branch information
danmihaila authored Aug 19, 2024
2 parents 1739827 + bf379bd commit 96e8511
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
51 changes: 33 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]
2 changes: 1 addition & 1 deletion docker_files/hxl_run
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 96e8511

Please sign in to comment.