forked from smicallef/spiderfoot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
67 lines (58 loc) · 2.06 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# Spiderfoot Dockerfile
#
# http://www.spiderfoot.net
#
# Written by: Michael Pellon <m@pellon.io>
# Updated by: Chandrapal <bnchandrapal@protonmail.com>
# Updated by: Steve Micallef <steve@binarypool.com>
# Updated by: Steve Bate <svc-spiderfoot@stevebate.net>
# -> Inspired by https://github.com/combro2k/dockerfiles/tree/master/alpine-spiderfoot
#
# Usage:
#
# sudo docker build -t spiderfoot .
# sudo docker run -p 5001:5001 spiderfoot
#
# Using Docker volume for spiderfoot data
#
# sudo docker run -p 5001:5001 -v /mydir/spiderfoot:/var/lib/spiderfoot spiderfoot
#
# Using SpiderFoot remote command line with web server
#
# docker run --rm -it spiderfoot sfcli.py -s http://my.spiderfoot.host:5001/
#
# Running spiderfoot commands without web server (can optionally specify volume)
#
# sudo docker run --rm spiderfoot sf.py -h
#
# Running spiderfoot unit tests in container
#
# sudo docker run --rm spiderfoot -m unittest discover -s test/unit
# Pull the base image.
FROM alpine:3.9.6
WORKDIR /home/spiderfoot
# Place database and configs outside installation directory
ENV SPIDERFOOT_DATA /var/lib/spiderfoot
COPY requirements.txt .
# Run everything as one command so that only one layer is created
RUN apk --update add --no-cache --virtual build-dependencies gcc git curl py3-pip swig \
tinyxml-dev python3-dev musl-dev openssl-dev libffi-dev libxslt-dev \
&& apk --update --no-cache add python3 musl openssl libxslt tinyxml jpeg-dev openjpeg-dev zlib-dev \
&& pip3 --no-cache-dir install wheel \
&& pip3 --no-cache-dir install -r requirements.txt \
&& addgroup spiderfoot \
&& adduser -G spiderfoot -h /home/spiderfoot -s /sbin/nologin \
-g "SpiderFoot User" -D spiderfoot \
&& apk del --purge build-dependencies \
&& rm -rf /var/cache/apk/* \
&& rm -rf /lib/apk/db \
&& rm -rf /root/.cache \
&& mkdir $SPIDERFOOT_DATA \
&& chown spiderfoot:spiderfoot /var/lib/spiderfoot
USER spiderfoot
EXPOSE 5001
# Run the application.
ENTRYPOINT ["/usr/bin/python3"]
CMD ["sf.py", "-l", "0.0.0.0:5001"]
COPY . .