geovisualisierung/projects/project-3/backend
2020-12-22 02:26:58 +01:00
..
routers Fix stupid accident dataset (remove duplicates?!?!) 2020-12-22 02:26:58 +01:00
.dockerignore Make project docker ready 2020-12-21 18:47:00 +01:00
.gitignore Update gitignore and requirements 2020-12-20 01:35:55 +01:00
api_database.py Another round of speed improvements 2020-12-20 19:15:25 +01:00
api.py Move openapi spec 2020-12-20 23:44:24 +01:00
db_init.py Fix stupid accident dataset (remove duplicates?!?!) 2020-12-22 02:26:58 +01:00
Dockerfile Make project docker ready 2020-12-21 18:47:00 +01:00
README.md Make project docker ready 2020-12-21 18:47:00 +01:00
requirements.txt Make project docker ready 2020-12-21 18:47:00 +01:00

Backend Project

1. Install requirements

pip3 install -r requirements.txt

2. Init database

To init the database it is required that you have at least python 3.7 installed.

Generate the database with

python3 db_init.py

Note: Import can be interrupted to resume it later!
Note: The importer outputs logs to the terminal, and the db_init.log file.

3. Start the backend

To start the backend, you first have to initialize the database!

Run with docker

Switch into the project directory, then run:

docker build -t geovis-backend .

After the build make sure you are in the same directory as "bike-data.db" resides, if so, run

docker run -v $(pwd):/app -p 8080:80 --restart always -d test

Note: $(pwd) puts the current directory in the command, if you are on Windows, you can use WSL or provide the full path by typing it out.

To stop just shut down the container.