-
-
Notifications
You must be signed in to change notification settings - Fork 150
Full Docker support #195
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
Open
acrois
wants to merge
30
commits into
ArchiveTeam:master
Choose a base branch
from
acrois:feature/dockerfile
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Full Docker support #195
Changes from 13 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
dcb5603
Add simplistic Dockerfile
Fusl 17507d8
added libffi-dev libressl-dev packages
Fusl 927a68b
added patch package
Fusl 59da795
lock python version to 3.7
Fusl 33cd061
Merge branch 'master' into feature/dockerfile
acrois 172479e
Parameterize dockerfile, separate volume for data vs installation dir…
acrois 6fb46f7
Add Docker usage to README.md
acrois 067dfdd
Add docker logs usage, attach to container, pause and resume crawl
acrois 9fc98eb
Add method to access running container (not PID 1)
acrois cbaf124
Update gs-server container name in documentation, update documentatio…
acrois e4fb82b
Update README.md
acrois ce419ad
Quick start usage, network isolation, remove need for --dir parameter
acrois e66de97
Merge branch 'ArchiveTeam:master' into feature/dockerfile
acrois ded3f49
Update Dockerfile
acrois f233c3f
Merge branch 'ArchiveTeam:master' into feature/dockerfile
acrois b434f39
Set executable bit in entrypoint.sh, rename grab-network to gs-networ…
acrois 74feab8
Executable bit
acrois 84d0236
Rename grab-network to gs-network, update documentation for single co…
acrois ec4c5d4
Executable bit
acrois 6570b0c
Merge branch 'feature/dockerfile' of https://github.com/acrois/grab-s…
acrois 44ae2fd
Add .gitattributes for LF preservation on Windows, update Python and …
acrois de68a6e
Use su-exec for step-down from root to grab-site user, update Docker …
acrois d4fbb98
Update documentation for more consistent Docker first-time run, adjus…
acrois c48f129
Adjust pip installation parameters
acrois a6210db
Update README to be easier to follow
acrois e8f82d4
Additional formatting and context to Docker README
acrois 7e20f21
Document Debian 11 Docker daemon setup, configuration option usage an…
acrois b7df3bf
Merge branch 'ArchiveTeam:master' into feature/dockerfile
acrois 534f7dc
Merge branch 'ArchiveTeam:master' into feature/dockerfile
acrois 3ee0d2f
feat: Docker build and release
acrois File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
__pycache__ | ||
Dockerfile | ||
data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
__pycache__ | ||
data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
ARG PYTHON_VERSION=3.7 | ||
ARG ALPINE_VERSION=3.13 | ||
|
||
FROM python:${PYTHON_VERSION}-alpine${ALPINE_VERSION} | ||
|
||
WORKDIR /app | ||
VOLUME [ "/data" ] | ||
|
||
ENV GRAB_SITE_INTERFACE=0.0.0.0 | ||
ENV GRAB_SITE_PORT=29000 | ||
ENV GRAB_SITE_HOST=127.0.0.1 | ||
EXPOSE 29000 | ||
|
||
RUN apk add --no-cache \ | ||
git \ | ||
gcc \ | ||
libxml2-dev \ | ||
musl-dev \ | ||
libxslt-dev \ | ||
g++ \ | ||
re2-dev \ | ||
libffi-dev \ | ||
openssl-dev \ | ||
patch \ | ||
cargo \ | ||
&& ln -s /usr/include/libxml2/libxml /usr/include/libxml \ | ||
&& addgroup -S grab-site \ | ||
&& adduser -S -G grab-site grab-site \ | ||
&& chown -R grab-site:grab-site $(pwd) \ | ||
&& mkdir -p /data \ | ||
&& chown -R grab-site:grab-site /data | ||
|
||
USER grab-site:grab-site | ||
ENV PATH="/app:$PATH" | ||
ENTRYPOINT [ "entrypoint.sh" ] | ||
CMD [ "gs-server" ] | ||
|
||
# TODO: resolve dependencies before loading library code to take advantage of build caching | ||
# setup.py requires libgrabsite/__init__.py (__version__ property) to work | ||
|
||
COPY --chown=grab-site:grab-site . . | ||
|
||
RUN pip install . \ | ||
acrois marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
&& chmod +x entrypoint.sh | ||
acrois marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
WORKDIR /data | ||
|
||
# docker build -t grab-site:latest . | ||
# docker run --rm -it --entrypoint sh grab-site:latest | ||
# docker network create -d bridge grab-network | ||
# docker run --net=grab-network --name=gs-server -d -p 29000:29000 --restart=unless-stopped grab-site:latest | ||
# docker run --net=grab-network --rm -d -e GRAB_SITE_HOST=gs-server -v ./data:/data:rw grab-site:latest grab-site https://www.example.com/ | ||
# docker run --net=grab-network --rm -d -e GRAB_SITE_HOST=gs-server -v C:\projects\grab-site\data:/data:rw grab-site:latest grab-site https://www.example.com/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env sh | ||
set -eax | ||
|
||
# TODO set docker default parameters (if not set) | ||
|
||
exec "$@" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.