|
| 1 | +# WorldMap Viewer |
| 2 | + |
| 3 | +This example provides a simple application with: |
| 4 | +- Incarnam and Amakna worldmap viewer using Leaflet.js |
| 5 | +- Shows teleportation cells on maps |
| 6 | +- Display a single map |
| 7 | + |
| 8 | +It uses database from [Araknemu](https://github.com/Arakne/Araknemu). |
| 9 | + |
| 10 | +## Installation (using docker) |
| 11 | + |
| 12 | +Retrieve all necessary assets: |
| 13 | +- Setup the araknemu database |
| 14 | +- Download and extract the Dofus 1.29 client |
| 15 | +- Download and extract the dofus maps |
| 16 | + |
| 17 | +Configure the `.env`: |
| 18 | + |
| 19 | +```bash |
| 20 | +# Configure the DB connection to your araknemu database |
| 21 | +# Don't forget that the database must be accessible from the docker container |
| 22 | +DB_DSN=mysql:host=172.17.0.1;dbname=araknemu |
| 23 | +DB_USER=araknemu |
| 24 | +DB_PASSWORD=araknemu |
| 25 | + |
| 26 | +# Do not change paths: they are mounted from the host to the container |
| 27 | +DOFUS_PATH=/srv/data/dofus |
| 28 | +MAPS_PATH=/srv/data/maps |
| 29 | + |
| 30 | +# Docker allows to bind ports from the host to the container |
| 31 | +# So port 80 is fine in this case |
| 32 | +LISTEN_PORT=80 |
| 33 | + |
| 34 | +# Number of worker processes |
| 35 | +# Consider setting this to the number of CPU cores you have on small traffics |
| 36 | +# Or the double on high traffics |
| 37 | +# Note: higher number of workers means more memory usage (one process = ~200MB) |
| 38 | +WORKER_COUNT=8 |
| 39 | +``` |
| 40 | + |
| 41 | +Create a `docker-compose.override.yml` file: |
| 42 | + |
| 43 | +```yaml |
| 44 | +services: |
| 45 | + php: |
| 46 | + restart: unless-stopped |
| 47 | + |
| 48 | + # Map the dofus client and maps from the host to the container |
| 49 | + # Also keep the cache as persistent volume, so it will not be rebuilt at each container restart |
| 50 | + volumes: |
| 51 | + - ./dofus/client/path:/srv/data/dofus:ro |
| 52 | + - ./dofus/maps/path:/srv/data/maps:ro |
| 53 | + - ./cache:/srv/cache |
| 54 | +``` |
| 55 | +
|
| 56 | +Now you can build and start the container: |
| 57 | +
|
| 58 | +```bash |
| 59 | +docker-compose build |
| 60 | +docker-compose up -d |
| 61 | +``` |
| 62 | + |
| 63 | +To optimise the cache, you can pre-generate the map tiles: |
| 64 | + |
| 65 | +```bash |
| 66 | +docker-compose exec php php index.php warmup |
| 67 | +``` |
| 68 | + |
| 69 | +> [!NOTE] |
| 70 | +> The `exec` command runs a command inside the running container, so make sure the container is running before executing it. |
| 71 | +> Use `run` instead of `exec` if you want to run it in a new container. |
| 72 | +
|
| 73 | +You can now access the application at [http://127.0.0.1:5000/](http://127.0.0.1:5000/) (or your server IP if not running locally). |
| 74 | + |
| 75 | +## Screenshot |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
0 commit comments