Skip to content

Commit

Permalink
Merge pull request #1827 from openzim/improved-docker-documentation
Browse files Browse the repository at this point in the history
Add details about how to retrieve ZIM file
  • Loading branch information
kelson42 authored Apr 5, 2023
2 parents 8565233 + 2708c87 commit 8674287
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,57 @@ without having to install all dependencies. You just need a working

## Standalone

MWoffliner requires a [Redis](http://www.redis.io) server to run.
MWoffliner requires a [Redis](https://www.redis.io) server to run.

For convenience purpose, MWoffliner image bundles a redis server launched in the background.
For convenience purpose, MWoffliner image bundles a Redis daemon launched in the background.

This bundled redis server is configured to be used only through a unix socket and to work exclusively from memory (no writes to disk).
This bundled Redis daemon is configured to be used only through a unix socket and to work exclusively from memory (no writes to disk).

Use of this bundled server is transparent as `mwoffliner` command is aliased to `mwoffliner --redis /dev/shm/redis.sock`.
Use of this bundled server is transparent as `mwoffliner` command is aliased to `mwoffliner --redis /dev/shm/redis.sock`.

``` sh
docker run -ti ghcr.io/openzim/mwoffliner mwoffliner --help
To run the following examples, you need first to create a local `out`
directory in you current directory. Created ZIM files will be written
there.

```sh
docker run --volume=$(pwd)/out:/out -ti ghcr.io/openzim/mwoffliner mwoffliner --help
```

## With dedicated redis
## With dedicated Redis

You can also use a dedicated redis container with MWoffliner.

Run a Redis docker container with:

```
$docker run --name=redis -d redis
```sh
docker run --volume=$(pwd)/out:/out --name=redis -d redis
```

... and then run the moffliner interactively (remember to specify `--redis` in command):

```
$docker run --link=redis:redis --name=mwoffliner -ti ghcr.io/openzim/mwoffliner
```sh
$docker run --volume=$(pwd)/out:/out --link=redis:redis --name=mwoffliner -ti ghcr.io/openzim/mwoffliner
```

... or non-interactively, directly with a command line (this is an
example, the second line is the mwoffliner command itself):

```
docker run --link=redis:redis --name=mwoffliner -e REDIS="redis://redis" ghcr.io/openzim/mwoffliner \
```sh
docker run --volume=$(pwd)/out:/out --link=redis:redis --name=mwoffliner -e REDIS="redis://redis" ghcr.io/openzim/mwoffliner \
mwoffliner --verbose --mwUrl=https://en.wikipedia.org/ --adminEmail=foo@bar.net
```

## With Docker compose

This allows to run both, Redis & MWoffliner, containers simultaneously:

```
```sh
docker-compose --file docker-compose.yml run mwoffliner
```

## Build the Docker image

Run from the repository root:
```
```sh
docker build . -f docker/Dockerfile -t ghcr.io/openzim/mwoffliner
```

0 comments on commit 8674287

Please sign in to comment.