Skip to content

Commit

Permalink
install nginx unit from source, along with a matching python module
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorescuserban committed Aug 6, 2024
1 parent 170929a commit 7e9c10a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
29 changes: 21 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
FROM public.ecr.aws/unocha/python:3.9-stable

ARG UNITD_VERSION=1.32.1-1

WORKDIR /srv/www

COPY . .

RUN apk add \
# 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 \
unit \
unit-python3 && \
pcre-dev && \
mkdir -p \
/etc/services.d/hxl \
/srv/cache \
Expand All @@ -23,11 +29,18 @@ RUN apk add \
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 -G unit && \
mkdir -p /var/lib/unit/ && \
rm -rf /root/.cache && \
rm -rf /var/cache/apk/*

Expand Down
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

0 comments on commit 7e9c10a

Please sign in to comment.