Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HDX-10073] update base image and remove legacy deps specifiers #489

Merged
merged 7 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading