Skip to content

Commit

Permalink
Dockerfile: add utils/ in $PATH by default, for easy indexing
Browse files Browse the repository at this point in the history
Signed-off-by: Théo Lebrun <[email protected]>
  • Loading branch information
tleb committed Dec 21, 2024
1 parent c3eabc1 commit d207b11
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
16 changes: 7 additions & 9 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ as a front-end to reduce the load on the server running the Elixir code.
== Keeping Elixir databases up to date

To keep your Elixir databases up to date and index new versions that are released,
we're proposing to use a script like `utils/index /srv/elixir-data --all` which is called
we're proposing to use a script like `index /srv/elixir-data --all` which is called
through a daily cron job.

You can set `$ELIXIR_THREADS` if you want to change the number of threads used by
Expand All @@ -282,18 +282,16 @@ The Docker image does not contain any repositories.
To index a repository, you can use the `index-repository` script.
For example, to add the https://musl.libc.org/[musl] repository, run:

# docker exec -it -e PYTHONUNBUFFERED=1 elixir-container \
/usr/local/elixir/utils/index -c '/srv/elixir-data musl'

Without PYTHONUNBUFFERED environment variable, update logs may show up with a delay.
# docker exec -it elixir-container \
index -c '/srv/elixir-data musl'

Or, to run indexing in a separate container:

# docker run -e PYTHONUNBUFFERED=1 -v ./elixir-data/:/srv/elixir-data \
--entrypoint /usr/local/elixir/utils/index elixir -c \
# docker run -v ./elixir-data/:/srv/elixir-data \
--entrypoint index elixir -c \
'/srv/elixir-data musl'

You can also use `utils/index /srv/elixir-data --all` to start indexing all officially supported repositories.
You can also use `index /srv/elixir-data --all` to start indexing all officially supported repositories.

After indexing is done, Elixir should be available under the following URL on your host:
http://172.17.0.2/musl/latest/source
Expand All @@ -305,7 +303,7 @@ If 172.17.0.2 does not answer, you can check the IP address of the container by
== Automatic repository updates

The Docker image does not automatically update repositories by itself.
You can, for example, start `utils/index /srv/elixir-data --all` in the container (or in a separate container, with Elixir data volume/directory mounted)
You can, for example, start `index /srv/elixir-data --all` in the container (or in a separate container, with Elixir data volume/directory mounted)
from cron on the host to periodically update repositories.

== Using Docker image as a development server
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,6 @@ ENV ELIXIR_VERSION=$ELIXIR_VERSION
ENV ELIXIR_ROOT=/srv/elixir-data
ENV PATH="/usr/local/elixir/venv/bin:$PATH"
ENV PYTHONUNBUFFERED=1
ENV PATH="/usr/local/elixir/utils:$PATH"

ENTRYPOINT ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]

0 comments on commit d207b11

Please sign in to comment.