diff --git a/README.md b/README.md index e69de29..fabb16a 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,38 @@ +# database PostGIS + +------------------ + +# 使い方 + +## PostGIS(osmdb) データベースを立ち上げる + +"PostGIS"を起動する + +* Use by DockerHub `kartoza/postgis:9.6-2.4` + +1) `docker pull kartoza/postgis:9.6-2.4` + +2) `WORKAREA=$pwd` + +3) `mkdir $HOME/pg_data` + +4) `docker run --name=osmdb -m 2g -d -e POSTGRES_USER=alex -e POSTGRES_PASS=password -e POSTGRES_DBNAME=osmdb -e ALLOW_IP_RANGE=0.0.0.0/0 -p 5432:5432 -v $HOME/pg_data:/var/lib/postgresql --restart=always kartoza/postgis:9.6-2.4` + + * `--name=osmdb` + * `-m 2g` momory 2GB + * `-e POSTGRES_USER=alex` + * `-e POSTGRES_PASS=password` + * `-e POSTGRES_DBNAME=osmdb` + * `-e ALLOW_IP_RANGE=0.0.0.0/0` すべてのIPからの接続を許可する + * `-p 5432:5432` + * `-v $HOME/pg_data:/var/lib/postgresql` PostgreSQL databade data folder + * `--restart=always` + +``` +$ docker pull kartoza/postgis:9.6-2.4 +$ mkdir +$ mkdir $HOME/pg_data +$ docker run -m 2g --name=osmdb -d -e POSTGRES_USER=alex -e POSTGRES_PASS=password -e POSTGRES_DBNAME=osmdb -e ALLOW_IP_RANGE=0.0.0.0/0 -p 5432:5432 -v $HOME/pg_data:/var/lib/postgresql --restart=always kartoza/postgis:9.6-2.4 +$ +``` + diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..34e4e84 --- /dev/null +++ b/start.sh @@ -0,0 +1,11 @@ +docker pull kartoza/postgis:9.6-2.4 +mkdir -p pg_data +docker run -d \ +-e POSTGRES_USER=alex \ +-e POSTGRES_PASS=password \ +-e POSTGRES_DBNAME=gisdb \ +-e ALLOW_IP_RANGE=0.0.0.0/0 \ +-p 5432:5432 \ +-v pg_data:/var/lib/postgresql \ +--name postgis kartoza/postgis:9.6-2.4 + diff --git a/stop.sh b/stop.sh new file mode 100755 index 0000000..cbe5c9a --- /dev/null +++ b/stop.sh @@ -0,0 +1,2 @@ +docker stop postgis +docker rm postgis