dont depend on README in Dockerfile install step

This commit is contained in:
Nick Sweeting 2021-04-05 23:17:07 -04:00
parent 6e1f1a2466
commit 2fc9f1cfa3
4 changed files with 24 additions and 24 deletions

View file

@ -73,10 +73,11 @@ ENV PATH="${PATH}:$VENV_PATH/bin"
RUN python -m venv --clear --symlinks "$VENV_PATH" \ RUN python -m venv --clear --symlinks "$VENV_PATH" \
&& pip install --upgrade --quiet pip setuptools && pip install --upgrade --quiet pip setuptools
ADD "./setup.py" "$CODE_DIR/" ADD "./setup.py" "$CODE_DIR/"
ADD "./README.md" "./package.json" "$CODE_DIR/archivebox/" ADD "./package.json" "$CODE_DIR/archivebox/"
RUN apt-get update -qq \ RUN apt-get update -qq \
&& apt-get install -qq -y --no-install-recommends \ && apt-get install -qq -y --no-install-recommends \
build-essential python-dev python3-dev \ build-essential python-dev python3-dev \
&& echo 'empty placeholder for setup.py to use' > "$CODE_DIR/archivebox/README.md" \
&& python3 -c 'from distutils.core import run_setup; result = run_setup("./setup.py", stop_after="init"); print("\n".join(result.install_requires + result.extras_require["sonic"]))' > /tmp/requirements.txt \ && python3 -c 'from distutils.core import run_setup; result = run_setup("./setup.py", stop_after="init"); print("\n".join(result.install_requires + result.extras_require["sonic"]))' > /tmp/requirements.txt \
&& pip install --quiet -r /tmp/requirements.txt \ && pip install --quiet -r /tmp/requirements.txt \
&& apt-get purge -y build-essential python-dev python3-dev \ && apt-get purge -y build-essential python-dev python3-dev \

View file

@ -110,7 +110,7 @@ curl -O 'https://raw.githubusercontent.com/ArchiveBox/ArchiveBox/master/docker-c
Start the server. Start the server.
<pre lang="bash"><code style="white-space: pre-line"> <pre lang="bash"><code style="white-space: pre-line">
docker-compose run --rm archivebox init --setup docker-compose run archivebox init --setup
docker-compose up docker-compose up
</code></pre> </code></pre>
@ -651,11 +651,13 @@ archivebox --version
# if you edit e.g. ./archivebox/core/models.py on the docker host, runserver # if you edit e.g. ./archivebox/core/models.py on the docker host, runserver
# inside the container will reload and pick up your changes # inside the container will reload and pick up your changes
docker build . -t archivebox docker build . -t archivebox
docker run -it --rm archivebox version docker run -it archivebox init --setup
docker run -it --rm -p 8000:8000 \ docker run -it -p 8000:8000 \
-v $PWD/data:/data \ -v $PWD/data:/data \
-v $PWD/archivebox:/app/archivebox \ -v $PWD/archivebox:/app/archivebox \
archivebox server 0.0.0.0:8000 --debug --reload archivebox server 0.0.0.0:8000 --debug --reload
# (remove the --reload flag and add the --nothreading flag when profiling with the django debug toolbar)
``` ```
### Common development tasks ### Common development tasks

View file

@ -438,17 +438,6 @@ def init(force: bool=False, quick: bool=False, setup: bool=False, out_dir: Path=
else: else:
print('{green}[√] Done. A new ArchiveBox collection was initialized ({} links).{reset}'.format(len(all_links) + len(pending_links), **ANSI)) print('{green}[√] Done. A new ArchiveBox collection was initialized ({} links).{reset}'.format(len(all_links) + len(pending_links), **ANSI))
if Snapshot.objects.count() < 25: # hide the hints for experienced users
print()
print(' {lightred}Hint:{reset} To view your archive index, run:'.format(**ANSI))
print(' archivebox server # then visit http://127.0.0.1:8000')
print()
print(' To add new links, you can run:')
print(" archivebox add ~/some/path/or/url/to/list_of_links.txt")
print()
print(' For more usage and examples, run:')
print(' archivebox help')
json_index = out_dir / JSON_INDEX_FILENAME json_index = out_dir / JSON_INDEX_FILENAME
html_index = out_dir / HTML_INDEX_FILENAME html_index = out_dir / HTML_INDEX_FILENAME
index_name = f"{date.today()}_index_old" index_name = f"{date.today()}_index_old"
@ -460,6 +449,17 @@ def init(force: bool=False, quick: bool=False, setup: bool=False, out_dir: Path=
if setup: if setup:
run_subcommand('setup', pwd=out_dir) run_subcommand('setup', pwd=out_dir)
if Snapshot.objects.count() < 25: # hide the hints for experienced users
print()
print(' {lightred}Hint:{reset} To view your archive index, run:'.format(**ANSI))
print(' archivebox server # then visit http://127.0.0.1:8000')
print()
print(' To add new links, you can run:')
print(" archivebox add ~/some/path/or/url/to/list_of_links.txt")
print()
print(' For more usage and examples, run:')
print(' archivebox help')
@enforce_types @enforce_types
def status(out_dir: Path=OUTPUT_DIR) -> None: def status(out_dir: Path=OUTPUT_DIR) -> None:
"""Print out some info and statistics about the archive collection""" """Print out some info and statistics about the archive collection"""

View file

@ -1,6 +1,6 @@
# Usage: # Usage:
# docker-compose up -d # docker-compose run archivebox init --setup
# docker-compose run archivebox init # docker-compose up
# echo "https://example.com" | docker-compose run archivebox archivebox add # echo "https://example.com" | docker-compose run archivebox archivebox add
# docker-compose run archivebox add --depth=1 https://example.com/some/feed.rss # docker-compose run archivebox add --depth=1 https://example.com/some/feed.rss
# docker-compose run archivebox config --set PUBLIC_INDEX=True # docker-compose run archivebox config --set PUBLIC_INDEX=True
@ -14,14 +14,11 @@ services:
# build: . # for developers working on archivebox # build: . # for developers working on archivebox
image: ${DOCKER_IMAGE:-archivebox/archivebox:latest} image: ${DOCKER_IMAGE:-archivebox/archivebox:latest}
command: server --quick-init 0.0.0.0:8000 command: server --quick-init 0.0.0.0:8000
stdin_open: true
tty: true
ports: ports:
- 8000:8000 - 8000:8000
environment: environment:
- ALLOWED_HOSTS=* # add any config options you want as env vars - ALLOWED_HOSTS=* # add any config options you want as env vars
- MEDIA_MAX_SIZE=750m - MEDIA_MAX_SIZE=750m
# - SHOW_PROGRESS=False
# - SEARCH_BACKEND_ENGINE=sonic # uncomment these if you enable sonic below # - SEARCH_BACKEND_ENGINE=sonic # uncomment these if you enable sonic below
# - SEARCH_BACKEND_HOST_NAME=sonic # - SEARCH_BACKEND_HOST_NAME=sonic
# - SEARCH_BACKEND_PASSWORD=SecretPassword # - SEARCH_BACKEND_PASSWORD=SecretPassword