sudo apt-get install \
unzip \
python3.7 \
python3-pip \
nginx \
nano \
npm \
git \
postgresql \
postgresql-contrib \
postgis \
libsqlite3-mod-spatialite
Create the database
sudo -u postgres createdb -E UTF8 bdms
Create the tables:
sudo -u postgres psql -d bdms -f db/1_schema.sql
Add default data:
sudo -u postgres psql -d bdms -f db/2_data.sql
sudo -u postgres psql -d bdms -f db/3_cantons.sql
sudo -u postgres psql -d bdms -f db/4_municipalities.sql
Or remotly with port forwarding:
ssh -R 9432:localhost:5432 USER_NAME@IP_ADDRESS
And then:
psql -U postgres -d bdms -h localhost -p 9432 -f db/1_schema.sql
psql -U postgres -d bdms -h localhost -p 9432 -f db/2_data.sql
psql -U postgres -d bdms -h localhost -p 9432 -f db/4_municipalities.sql
psql -U postgres -d bdms -h localhost -p 9432 -f db/3_cantons.sql
sudo apt-get install python3-venv
python3.7 -m venv ./venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
source venv/bin/activate
python bms/main.py --pg-database=bdms
Config parameters:
--pg-database PostgrSQL database name (default bms)
--pg-host PostgrSQL database host (default localhost)
--pg-password PostgrSQL user password (default postgres)
--pg-port PostgrSQL database port (default 5432)
--pg-user PostgrSQL database user (default postgres)
--port Tornado Web port (default 8888)
Docker install:
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
Git install:
sudo apt-get install git
Clone server repository:
git clone https://github.com/geoadmin/service-bdms
cd service-bdms
Build Docker image (x.x.x is the release number, start with 1.0.0):
sudo docker build -t swisstopo/bdms:x.x.x ./config
Run Docker container (x.x.x is the release number, start with 1.0.0):
sudo docker run -d --name bdmsContainer -p 80:80 swisstopo/bdms:x.x.x