Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions cmd/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,27 @@ register 'compose' 'ps' 'list containers' compose_ps
function compose_top(){ compose_exec top $@; }
register 'compose' 'top' 'display the running processes of a container' compose_top

# the 'docker compose' subcommand is now the recommended method of calling compose.
# if not available, we fallback to the legacy 'docker-compose' command.
function compose_exec(){
# check whether there is a local compose file and append them to the global one.
composeFilePath="-f ../../docker-compose.yml -f ./docker-compose.yml"
export peliasRegion="projects/$(basename $(pwd))"
if [ ! -f docker-compose.yml ];then
echo "No local file. Using only global compose file."
composeFilePath="-f ../../docker-compose.yml"
fi

# the 'docker compose' subcommand is now the recommended method of calling compose.
# if not available, we fallback to the legacy 'docker-compose' command.
NATIVE_COMPOSE_VERSION=$(docker compose version 2> /dev/null || true)
if [ -z "$NATIVE_COMPOSE_VERSION" ]; then
docker-compose $@;
dockerComposeCommand="docker-compose"
else
docker compose $@;
dockerComposeCommand="docker compose"
fi

# execute the command with the compose file(s) and any additional arguments
$dockerComposeCommand $composeFilePath $@;
unset $peliasRegion
}
register 'compose' 'exec' 'execute an arbitrary `docker compose` command' compose_exec

Expand All @@ -40,4 +52,3 @@ register 'compose' 'kill' 'kill one or more `docker compose` service(s)' compose

function compose_down(){ compose_exec down; }
register 'compose' 'down' 'stop all `docker compose` service(s)' compose_down

136 changes: 136 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
version: '3'
networks:
default:
driver: bridge
services:
libpostal:
image: pelias/libpostal-service
container_name: pelias_libpostal
user: "${DOCKER_USER}"
restart: always
ports: [ "127.0.0.1:${PELIAS_LIBPOSTAL_PORT:-4400}:4400" ]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since libpostal won't provide a custom port configuration inside the container it stays on 4400 internally.

schema:
image: pelias/schema:master
container_name: pelias_schema
user: "${DOCKER_USER}"
volumes:
- "./${peliasRegion}/pelias.json:/code/pelias.json"
api:
image: pelias/api:master
container_name: pelias_api
user: "${DOCKER_USER}"
restart: always
environment: [ "PORT=${PELIAS_API_PORT:-4000}" ]
ports: [ "0.0.0.0:${PELIAS_API_PORT:-4000}:${PELIAS_API_PORT:-4000}" ]
volumes:
- "./${peliasRegion}/pelias.json:/code/pelias.json"
placeholder:
image: pelias/placeholder:master
container_name: pelias_placeholder
user: "${DOCKER_USER}"
restart: always
environment: [ "PORT=${PELIAS_PLACEHOLDER_PORT:-4100}" ]
ports: [ "127.0.0.1:${PELIAS_PLACEHOLDER_PORT:-4100}:${PELIAS_PLACEHOLDER_PORT:-4100}" ]
volumes:
- "./${peliasRegion}/pelias.json:/code/pelias.json"
- "./${peliasRegion}/${DATA_DIR}:/data"
- "./${peliasRegion}/blacklist/:/data/blacklist"
whosonfirst:
image: pelias/whosonfirst:master
container_name: pelias_whosonfirst
user: "${DOCKER_USER}"
volumes:
- "./${peliasRegion}/pelias.json:/code/pelias.json"
- "./${peliasRegion}/${DATA_DIR}:/data"
- "./${peliasRegion}/blacklist/:/data/blacklist"
openstreetmap:
image: pelias/openstreetmap:master
container_name: pelias_openstreetmap
user: "${DOCKER_USER}"
volumes:
- "./${peliasRegion}/pelias.json:/code/pelias.json"
- "./${peliasRegion}/${DATA_DIR}:/data"
- "../${peliasRegion}/blacklist/:/data/blacklist"
openaddresses:
image: pelias/openaddresses:master
container_name: pelias_openaddresses
user: "${DOCKER_USER}"
volumes:
- "./${peliasRegion}/pelias.json:/code/pelias.json"
- "./${peliasRegion}/${DATA_DIR}:/data"
- "./${peliasRegion}/blacklist/:/data/blacklist"
geonames:
image: pelias/geonames:master
container_name: pelias_geonames
user: "${DOCKER_USER}"
volumes:
- "./${peliasRegion}/pelias.json:/code/pelias.json"
- "./${peliasRegion}/${DATA_DIR}:/data"
- "./${peliasRegion}/blacklist/:/data/blacklist"
transit:
image: pelias/transit:master
container_name: pelias_transit
user: "${DOCKER_USER}"
volumes:
- "./${peliasRegion}/pelias.json:/code/pelias.json"
- "./${peliasRegion}/${DATA_DIR}:/data"
csv-importer:
image: pelias/csv-importer:master
container_name: pelias_csv_importer
user: "${DOCKER_USER}"
volumes:
- "./${peliasRegion}/pelias.json:/code/pelias.json"
- "./${peliasRegion}/${DATA_DIR}:/data"
- "./${peliasRegion}/blacklist/:/data/blacklist"
polylines:
image: pelias/polylines:master
container_name: pelias_polylines
user: "${DOCKER_USER}"
volumes:
- "./${peliasRegion}/pelias.json:/code/pelias.json"
- "./${peliasRegion}/${DATA_DIR}:/data"
interpolation:
image: pelias/interpolation:master
container_name: pelias_interpolation
user: "${DOCKER_USER}"
restart: always
environment: [ "PORT=${PELIAS_INTERPOLATION_PORT:-4300}" ]
ports: [ "127.0.0.1:${PELIAS_INTERPOLATION_PORT:-4300}:${PELIAS_INTERPOLATION_PORT:-4300}" ]
volumes:
- "./${peliasRegion}/pelias.json:/code/pelias.json"
- "./${peliasRegion}/${DATA_DIR}:/data"
pip:
image: pelias/pip-service:master
container_name: pelias_pip-service
user: "${DOCKER_USER}"
restart: always
environment: [ "PORT=${PELIAS_PIP_PORT:-4200}" ]
ports: [ "127.0.0.1:${PELIAS_PIP_PORT:-4200}:${PELIAS_PIP_PORT:-4200}" ]
volumes:
- "./${peliasRegion}/pelias.json:/code/pelias.json"
- "./${peliasRegion}/${DATA_DIR}:/data"
elasticsearch:
image: pelias/elasticsearch:7.17.27
container_name: pelias_elasticsearch
user: "${DOCKER_USER}"
restart: always
ports: [ "127.0.0.1:${PELIAS_ELASTIC_PORT:-9200}:9200", "127.0.0.1:${PELIAS_ELASTIC_NODE_PORT:-9300}:9300" ]
volumes:
- "./${peliasRegion}/${DATA_DIR}/elasticsearch:/usr/share/elasticsearch/data"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
cap_add: [ "IPC_LOCK" ]
fuzzy-tester:
image: pelias/fuzzy-tester:master
container_name: pelias_fuzzy_tester
user: "${DOCKER_USER}"
restart: "no"
command: "--help"
volumes:
- "./${peliasRegion}/pelias.json:/code/pelias.json"
- "./${peliasRegion}/test_cases:/code/pelias/fuzzy-tester/test_cases"
8 changes: 8 additions & 0 deletions projects/australia/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
COMPOSE_PROJECT_NAME=pelias
DATA_DIR=/tmp/pelias/australia
PELIAS_REGION=./projects/australia
PELIAS_LIBPOSTAL_PORT=4400
PELIAS_API_PORT=4000
PELIAS_PLACEHOLDER_PORT=4100
PELIAS_INTERPOLATION_PORT=4300
PELIAS_PIP_PORT=4200
PELIAS_ELASTIC_PORT=9200
PELIAS_ELASTIC_NODE_PORT=9300
136 changes: 0 additions & 136 deletions projects/australia/docker-compose.yml

This file was deleted.

8 changes: 8 additions & 0 deletions projects/austria/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
COMPOSE_PROJECT_NAME=pelias
DATA_DIR=/tmp/pelias/austria
PELIAS_REGION=./projects/austria
PELIAS_LIBPOSTAL_PORT=4400
PELIAS_API_PORT=4000
PELIAS_PLACEHOLDER_PORT=4100
PELIAS_INTERPOLATION_PORT=4300
PELIAS_PIP_PORT=4200
PELIAS_ELASTIC_PORT=9200
PELIAS_ELASTIC_NODE_PORT=9300
Loading