2024-03-11 16:33:53 +00:00
|
|
|
FROM alpine:3.19
|
2019-08-16 14:43:10 +00:00
|
|
|
#
|
2018-08-14 14:20:55 +00:00
|
|
|
# Include dist
|
2022-03-08 23:36:03 +00:00
|
|
|
COPY dist/ /root/dist/
|
2019-08-16 14:43:10 +00:00
|
|
|
#
|
2024-09-11 10:42:17 +00:00
|
|
|
# Install packages
|
2024-12-05 18:32:20 +00:00
|
|
|
RUN apk --no-cache -U upgrade && \
|
|
|
|
apk --no-cache -U add \
|
2024-03-11 16:33:53 +00:00
|
|
|
build-base \
|
|
|
|
git \
|
|
|
|
linux-headers \
|
|
|
|
python3 \
|
|
|
|
python3-dev \
|
|
|
|
py3-aiohttp \
|
|
|
|
py3-beautifulsoup4 \
|
|
|
|
py3-gitpython \
|
|
|
|
py3-jinja2 \
|
|
|
|
py3-markupsafe \
|
|
|
|
py3-setuptools \
|
|
|
|
py3-pip \
|
|
|
|
py3-pycodestyle \
|
|
|
|
py3-wheel && \
|
2019-08-16 14:43:10 +00:00
|
|
|
#
|
2018-05-28 16:36:02 +00:00
|
|
|
# Setup Snare
|
2020-09-04 12:37:28 +00:00
|
|
|
git clone https://github.com/mushorg/snare /opt/snare && \
|
2018-05-26 23:09:31 +00:00
|
|
|
cd /opt/snare/ && \
|
2024-03-11 16:33:53 +00:00
|
|
|
git checkout 08c69b7165354ea2040b6170c37d92ff3c304f96 && \
|
2022-03-14 21:50:19 +00:00
|
|
|
cp /root/dist/requirements.txt . && \
|
2024-03-11 16:33:53 +00:00
|
|
|
pip3 install --break-system-packages --no-cache-dir -r requirements.txt && \
|
2019-08-16 15:59:05 +00:00
|
|
|
python3 setup.py install && \
|
2018-08-02 22:17:03 +00:00
|
|
|
cd / && \
|
|
|
|
rm -rf /opt/snare && \
|
2020-06-26 14:34:05 +00:00
|
|
|
mkdir -p /opt/snare/pages && \
|
2018-08-14 14:20:55 +00:00
|
|
|
mv /root/dist/pages/* /opt/snare/pages/ && \
|
2022-03-08 23:36:03 +00:00
|
|
|
#
|
|
|
|
# Setup configs, user, groups
|
|
|
|
addgroup -g 2000 snare && \
|
|
|
|
adduser -S -s /bin/ash -u 2000 -D -g 2000 snare && \
|
|
|
|
mkdir /var/log/tanner && \
|
|
|
|
chown -R snare:snare /opt/snare && \
|
2019-08-16 14:43:10 +00:00
|
|
|
#
|
2018-05-26 23:09:31 +00:00
|
|
|
# Clean up
|
|
|
|
apk del --purge \
|
|
|
|
build-base \
|
|
|
|
linux-headers \
|
|
|
|
python3-dev && \
|
2024-09-11 10:42:17 +00:00
|
|
|
rm -rf /root/* \
|
|
|
|
/tmp/* /var/tmp/* \
|
|
|
|
/var/cache/apk/*
|
2019-08-16 14:43:10 +00:00
|
|
|
#
|
2018-05-26 23:09:31 +00:00
|
|
|
# Start snare
|
2018-09-11 12:19:26 +00:00
|
|
|
STOPSIGNAL SIGKILL
|
2022-03-08 23:36:03 +00:00
|
|
|
USER snare:snare
|
2022-01-20 17:47:29 +00:00
|
|
|
CMD snare --tanner tanner --debug true --auto-update false --host-ip 0.0.0.0 --port 80 --page-dir $(shuf -i 1-10 -n 1)
|