GithubHelp home page GithubHelp logo

dzanin / service-bdms Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ckaenzig/service-bdms

0.0 0.0 0.0 66.44 MB

TODO: add a description (iwibot)

License: GNU General Public License v3.0

Python 98.05% Dockerfile 0.20% Shell 0.06% TSQL 1.69%

service-bdms's Introduction

Borehole Management System Service

Installation

sudo apt-get install \
    unzip \
    python3.7 \
    python3-pip \
    nginx \
    nano \
    npm \
    git \
    postgresql \
    postgresql-contrib \
    postgis \
    libsqlite3-mod-spatialite 

Database initilization

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/3_cantons.sql
psql -U postgres -d bdms -h localhost -p 9432 -f db/4_municipalities.sql

Run Server

Setup virtual environment

sudo apt-get install python3-venv
python3.7 -m venv ./venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt

Activate virtual environment

source venv/bin/activate

Run Server

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)
--pg-upgrade       Upgrade PostgrSQL schema (default false)
--port             Tornado Web port (default 8888)

Run with docker

Installation

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

Build image and run docker

Clone server repository:

git clone https://github.com/geoadmin/service-bdms.git
cd service-bdms

Build Docker image (x.x.x is the release number, start with 1.0.0):

 sudo docker build -t swisstopo/service-bdms:x.x.x .

Run Docker container (x.x.x is the release number, start with 1.0.0):

N.B. Run with Docker-compose is preferred, please see docker-compose.yml.

sudo docker run -d --name service-bdms swisstopo/service-bdms:x.x.x

Run Docker container with bash in interactive mode (during dev):

sudo docker run -it --name service-bdms swisstopo/service-bdms:x.x.x /bin/bash

service-bdms's People

Contributors

ckaenzig avatar dzanin avatar mantonovic avatar massimiliano-cannata avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.