2021-10-01 14:32:24 +00:00
|
|
|
FROM alpine:3.14
|
2019-10-16 14:46:58 +00:00
|
|
|
#
|
2018-03-25 18:35:32 +00:00
|
|
|
# Include dist
|
|
|
|
ADD dist/ /root/dist/
|
2019-10-16 14:46:58 +00:00
|
|
|
#
|
2018-03-25 18:35:32 +00:00
|
|
|
# Install packages
|
2021-02-16 16:59:17 +00:00
|
|
|
RUN apk -U --no-cache add \
|
2018-05-07 20:25:00 +00:00
|
|
|
build-base \
|
|
|
|
git \
|
|
|
|
libcap \
|
|
|
|
libffi-dev \
|
2019-02-25 13:55:46 +00:00
|
|
|
openssl-dev \
|
2021-11-16 18:23:25 +00:00
|
|
|
py3-pyzmq \
|
2018-05-07 20:25:00 +00:00
|
|
|
postgresql-dev \
|
2020-06-25 16:14:37 +00:00
|
|
|
py3-pip \
|
2018-05-07 20:25:00 +00:00
|
|
|
python3 \
|
2021-10-01 14:32:24 +00:00
|
|
|
python3-dev && \
|
2019-10-16 14:46:58 +00:00
|
|
|
#
|
2018-03-25 18:35:32 +00:00
|
|
|
# Setup heralding
|
|
|
|
mkdir -p /opt && \
|
|
|
|
cd /opt/ && \
|
2020-09-04 12:37:28 +00:00
|
|
|
git clone https://github.com/johnnykv/heralding && \
|
2018-03-25 18:35:32 +00:00
|
|
|
cd heralding && \
|
2021-11-16 18:23:25 +00:00
|
|
|
git checkout c31f99c55c7318c09272d8d9998e560c3d4de9aa && \
|
2021-10-01 14:32:24 +00:00
|
|
|
pip3 install --upgrade pip && \
|
2018-05-07 20:25:00 +00:00
|
|
|
pip3 install --no-cache-dir -r requirements.txt && \
|
2018-09-11 12:19:26 +00:00
|
|
|
pip3 install --no-cache-dir . && \
|
2019-10-16 14:46:58 +00:00
|
|
|
#
|
2018-03-25 18:35:32 +00:00
|
|
|
# Setup user, groups and configs
|
|
|
|
addgroup -g 2000 heralding && \
|
2018-05-07 20:25:00 +00:00
|
|
|
adduser -S -H -s /bin/ash -u 2000 -D -g 2000 heralding && \
|
2018-03-31 21:44:11 +00:00
|
|
|
mkdir -p /var/log/heralding/ /etc/heralding && \
|
|
|
|
mv /root/dist/heralding.yml /etc/heralding/ && \
|
2021-10-01 14:32:24 +00:00
|
|
|
setcap cap_net_bind_service=+ep /usr/bin/python3.9 && \
|
2018-05-07 20:25:00 +00:00
|
|
|
chown -R heralding:heralding /var/log/heralding && \
|
2019-10-16 14:46:58 +00:00
|
|
|
#
|
2018-03-25 18:35:32 +00:00
|
|
|
# Clean up
|
2018-03-25 20:58:46 +00:00
|
|
|
apk del --purge \
|
|
|
|
build-base \
|
|
|
|
git \
|
2018-05-07 20:25:00 +00:00
|
|
|
libcap \
|
2018-03-25 20:58:46 +00:00
|
|
|
libffi-dev \
|
|
|
|
libressl-dev \
|
|
|
|
postgresql-dev \
|
2021-10-01 14:32:24 +00:00
|
|
|
python3-dev && \
|
2018-05-07 20:25:00 +00:00
|
|
|
rm -rf /root/* \
|
|
|
|
/var/cache/apk/* \
|
|
|
|
/opt/heralding
|
2019-10-16 14:46:58 +00:00
|
|
|
#
|
2020-01-02 17:37:08 +00:00
|
|
|
# Start Heralding
|
2018-09-11 12:19:26 +00:00
|
|
|
STOPSIGNAL SIGINT
|
2018-03-31 21:44:11 +00:00
|
|
|
WORKDIR /tmp/heralding/
|
2018-05-07 20:25:00 +00:00
|
|
|
USER heralding:heralding
|
2018-04-17 13:54:57 +00:00
|
|
|
CMD exec heralding -c /etc/heralding/heralding.yml -l /var/log/heralding/heralding.log
|