docker-compose build
docker-compose up -d
python models.py
python start.py
gunicorn -b 0.0.0.0:9000 app:server --timeout 300
##No navegador:
localhost:9000
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib
cd /etc/postgresql/10/main
sudo gedit pg_hba.conf
# DO NOT DISABLE!
# If you change this first entry you will need to make sure that the
# database superuser can access the database using some other method.
# Noninteractive access to all databases is required during automatic
# maintenance (custom daily cronjobs, replication, and similar tasks).
#
# Database administrative login by Unix domain socket
local all postgres trust
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all trust
host replication all 127.0.0.1/32 trust
host replication all ::1/128 trust
sudo service postgresql restart
sudo -u postgres psql # abre o prompt do postgres
CREATE DATABASE peoplecounter;
pip install virtualenv
virtualenv -p python3 venv
source venv/bin/activate
pip3 install -r requirements.txt
python3 models.py
python3 start.py
sudo -u postgres psql
\c peoplecounter;
select c.camera_id, c.nome as camera, l.nome as local, l.endereco, cl.nome as cliente
from cameras c
left join locais l on c.local_id = l.local_id
left join clientes cl ON l.cliente_id = cl.cliente_id;