2020-02-25 16:59:22 +00:00
|
|
|
FROM alpine:latest
|
2019-08-28 14:12:52 +00:00
|
|
|
#
|
2017-10-13 18:58:14 +00:00
|
|
|
# Include dist
|
|
|
|
ADD dist/ /root/dist/
|
2019-08-28 14:12:52 +00:00
|
|
|
#
|
2017-10-13 18:58:14 +00:00
|
|
|
# Install packages
|
2018-05-07 10:17:33 +00:00
|
|
|
RUN apk -U --no-cache add \
|
|
|
|
git \
|
|
|
|
python3 && \
|
|
|
|
pip3 install --no-cache-dir --upgrade pip && \
|
|
|
|
pip3 install --no-cache-dir bottle \
|
|
|
|
configparser \
|
|
|
|
datetime \
|
|
|
|
requests && \
|
2017-10-13 18:58:14 +00:00
|
|
|
mkdir -p /opt && \
|
|
|
|
cd /opt/ && \
|
2018-05-15 20:49:06 +00:00
|
|
|
git clone --depth=1 https://github.com/schmalle/ElasticpotPY.git && \
|
2019-08-28 14:12:52 +00:00
|
|
|
#
|
2017-10-13 18:58:14 +00:00
|
|
|
# Setup user, groups and configs
|
|
|
|
addgroup -g 2000 elasticpot && \
|
2018-05-07 10:17:33 +00:00
|
|
|
adduser -S -H -s /bin/ash -u 2000 -D -g 2000 elasticpot && \
|
2017-10-13 18:58:14 +00:00
|
|
|
mv /root/dist/elasticpot.cfg /opt/ElasticpotPY/ && \
|
|
|
|
mkdir /opt/ElasticpotPY/log && \
|
2019-08-28 14:12:52 +00:00
|
|
|
#
|
2017-10-13 18:58:14 +00:00
|
|
|
# Clean up
|
2018-03-31 15:18:28 +00:00
|
|
|
apk del --purge git && \
|
2017-10-13 18:58:14 +00:00
|
|
|
rm -rf /root/* && \
|
|
|
|
rm -rf /var/cache/apk/*
|
2019-08-28 14:12:52 +00:00
|
|
|
#
|
2017-10-13 18:58:14 +00:00
|
|
|
# Start elasticpot
|
2018-09-11 12:19:26 +00:00
|
|
|
STOPSIGNAL SIGINT
|
2018-03-31 15:18:28 +00:00
|
|
|
USER elasticpot:elasticpot
|
2017-10-13 18:58:14 +00:00
|
|
|
WORKDIR /opt/ElasticpotPY/
|
|
|
|
CMD ["/usr/bin/python3","main.py"]
|