pelias / docker

Run the Pelias geocoder in docker containers, including example projects.
MIT License
314 stars 217 forks source link

docker compose instead of docker-compose and added project denmark #301

Closed welrachid closed 1 year ago

welrachid commented 1 year ago

added project denmark

Just added it to be able to compile and run for the country Denmark. spent some time doing it. i guess someone could benefit from this.

Used norway as a base. Tried to do it without whosonfirst (wof) but then i didnt get any result at all. Once i added it, it worked great.

Took about an hour on a virtualbox VM (ubuntu guest) with 6GB ram and 6 CPU

welrachid commented 1 year ago

I've also edited docker compose instead of docker-compose.

This is because docker now comes with docker compose as part of it. For a fresh install docker always comes with docker compose as part of it. this means that the CLI will not run properly unless the docker.sh file is updated.

missinglink commented 1 year ago

Heya, thanks for the contribution. I saw that compose was included as a subcommand of docker some time back, which is awesome.

Can I ask that we decouple these two code changes into separate PRs? (ie. the project and the change to compose)

I had a quick look to try and figure out which version of docker it's available from and couldn't find an exact number, the install docs seem to suggest that it's available by default on MacOS but not for linux, is that correct? 🤔

missinglink commented 1 year ago

I just logged into an older Linux server I have and the command isn't available, it's likely that my software is not current, but it's indicative of an issue that other users may face and a potential headache for the maintainers.

I hope we can figure out a way for it to 'just work' for everyone.

$ docker compose
docker: 'compose' is not a docker command.
See 'docker --help'

$ docker --version
Docker version 20.10.12, build e91ed57

$ uname -a
Linux *** 4.15.0-74-generic #84-Ubuntu SMP Thu Dec 19 08:06:28 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
w0pr commented 1 year ago

I just logged into an older Linux server I have and the command isn't available, it's likely that my software is not current, but it's indicative of an issue that other users may face and a potential headache for the maintainers.

It is in docker-compose-plugin: https://pkgs.org/download/docker-compose-plugin

welrachid commented 1 year ago

hey sorry. im still very new to github and crossproject PR, so i'll try doing some branching for you and i'll make a refactor for the command..

#!/bin/bash
set -e;

if ! command -v docker-compose &> /dev/null
then
    DOCKER_COMPOSE_COMMAND="docker compose"
    exit
else 
    DOCKER_COMPOSE_COMMAND="docker-compose"
fi
........
........

function compose_exec(){ ${DOCKER_COMPOSE_COMMAND} $@; }
register 'compose' 'exec' 'execute an arbitrary ${DOCKER_COMPOSE_COMMAND} command' compose_exec
welrachid commented 1 year ago

i've creeated: https://github.com/pelias/docker/pull/302 and https://github.com/pelias/docker/pull/303