Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker: Ignore git, logs, docs, temp and build files #1182

Merged
merged 1 commit into from
Jun 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Docker: Ignore git, logs, docs, temp and build files
  • Loading branch information
bcoles committed Jun 13, 2021
commit 523ce44cca651cbfbc12f09cecb94295b4e5bb78
15 changes: 14 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
.git/

build
dist
*.egg-info
*.egg/
*.pyc
*.swp

venv/
cache/
log/
spiderfoot.db*
spiderfoot.test.db

*.log
__pycache__
htmlcov/
docs/
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
#
# sudo docker run --rm spiderfoot sf.py -h
#
# Running a shell in the container for maintenance
# sudo docker run -it --entrypoint /bin/sh spiderfoot
#
# Running spiderfoot unit tests in container
#
# sudo docker build -t spiderfoot-test --build-arg REQUIREMENTS=requirements_test.txt .
# sudo docker run --rm spiderfoot-test -m pytest --flake8 .

Expand All @@ -47,6 +51,8 @@ RUN pip3 install -r "$REQUIREMENTS"

FROM alpine:3.12.4
WORKDIR /home/spiderfoot
ENV SPIDERFOOT_LOGS /home/spiderfoot/log

# Place database and configs outside installation directory
ENV SPIDERFOOT_DATA /var/lib/spiderfoot

Expand All @@ -59,14 +65,11 @@ RUN apk --update --no-cache add python3 musl openssl libxslt tinyxml libxml2 jpe
&& rm -rf /lib/apk/db \
&& rm -rf /root/.cache \
&& mkdir $SPIDERFOOT_DATA \
&& mkdir $SPIDERFOOT_LOGS \
&& chown spiderfoot:spiderfoot $SPIDERFOOT_LOGS \
&& chown spiderfoot:spiderfoot $SPIDERFOOT_DATA

COPY . .

# fix permissions on logs directory
ENV SPIDERFOOT_LOGS /home/spiderfoot/log
RUN chown spiderfoot:spiderfoot $SPIDERFOOT_LOGS

COPY --from=build /opt/venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"

Expand Down