tpotce/docker/heralding/Dockerfile

57 lines
1.6 KiB
Text
Raw Normal View History

2020-09-04 12:37:28 +00:00
FROM alpine:3.12
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
2020-01-02 17:37:08 +00:00
RUN sed -i 's/dl-cdn/dl-2/g' /etc/apk/repositories && \
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 \
2018-05-18 15:50:01 +00:00
libzmq \
2018-05-07 20:25:00 +00:00
postgresql-dev \
py3-pip \
2018-05-07 20:25:00 +00:00
python3 \
python3-dev \
py-virtualenv && \
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 && \
2020-09-04 12:37:28 +00:00
git checkout bc1320e2d056c730c821cd42a19a262bfceebfd7 && \
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/ && \
setcap cap_net_bind_service=+ep /usr/bin/python3.8 && \
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 \
python3-dev \
py-virtualenv && \
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