tpotce/docker/heralding/Dockerfile

54 lines
1.5 KiB
Text
Raw Normal View History

2018-03-25 18:35:32 +00:00
FROM alpine
# Include dist
ADD dist/ /root/dist/
# Install packages
2018-05-07 20:25:00 +00:00
RUN apk -U --no-cache add \
build-base \
git \
libcap \
libffi-dev \
libressl-dev \
2018-05-18 15:50:01 +00:00
libzmq \
2018-05-07 20:25:00 +00:00
postgresql-dev \
python3 \
python3-dev \
py-virtualenv && \
pip3 install --no-cache-dir --upgrade pip && \
2018-03-25 18:35:32 +00:00
# Setup heralding
mkdir -p /opt && \
cd /opt/ && \
2018-05-07 20:25:00 +00:00
git clone --depth=1 https://github.com/johnnykv/heralding && \
2018-03-25 18:35:32 +00:00
cd heralding && \
2018-05-07 20:25:00 +00:00
pip3 install --no-cache-dir -r requirements.txt && \
pip3 install --no-cache-dir heralding && \
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/ && \
2018-05-07 20:25:00 +00:00
setcap cap_net_bind_service=+ep /usr/bin/python3.6 && \
chown -R heralding:heralding /var/log/heralding && \
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
2018-03-25 18:35:32 +00:00
# Start elasticpot
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