master
ifiguero 2023-03-01 14:18:49 -03:00
parent 3a48d10239
commit 7d1775ed6a
126 changed files with 1533 additions and 0 deletions

29
Dockerfile 100644
View File

@ -0,0 +1,29 @@
FROM ubuntu:22.04
#FROM debian:buster-slim
#FROM python:3
RUN apt-get update -y
RUN apt-get install -y python3-pip python3-bs4
# set a directory for the app
RUN groupadd app && useradd -m -g app app
# copy all the files to the container
#RUN git clone https://dev.ilab.cl/public/pythonweb.git /srv
COPY app.py /srv
COPY webinterface /srv/webinterface
RUN chown -R app:app /srv
# install dependencies
WORKDIR /srv
RUN pip3 install setuptools gunicorn
RUN pip3 install --no-cache-dir -r webinterface/requirements.txt
USER app
# define the port number the container should expose
EXPOSE 8000
# run the command
ENTRYPOINT ["gunicorn"]
CMD ["-b", "0.0.0.0:8000", "app:iapp"]

13
Setup.sh 100755
View File

@ -0,0 +1,13 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]; then
echo "Este script requiere permisos de root."
exit
fi
apt update
apt install -y python3-pip
pip3 install setuptools gunicorn
pip3 install -r web-interface/requirements.txt

21
WebService.sh 100644
View File

@ -0,0 +1,21 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]; then
echo "Este script requiere permisos de root."
exit
fi
apt-get update
apt-get install -y python3-pip
git clone https://dev.ilab.cl/public/pythonweb.git /srv
cd /srv
pip3 install setuptools gunicorn
pip3 install -r web-interface/requirements.txt
cp -f webinterface.service.sample /etc/systemd/system/webinterface.service
systemctl unmask webinterface.service
systemctl enable webinterface.service
systemctl start webinterface.service

6
app.py 100644
View File

@ -0,0 +1,6 @@
from webinterface import create_app
iapp = create_app()
if __name__ == '__main__':
iapp.run()

15
bp.sh 100755
View File

@ -0,0 +1,15 @@
#!/bin/bash
die(){
echo "$1"
exit 1
}
# if not enough args displayed, display an error and die
[ $# -eq 0 ] && die "Usage: $0 [devel|stable|tag]"
docker build -t docker.ilab.cl/ilab-mtt:$1 .
if [ $1 == "stable" ]; then
docker image push docker.ilab.cl/ilab-mtt:$1
fi
docker-compose up

21
crea_db.py 100644
View File

@ -0,0 +1,21 @@
from webinterface import create_app, Config, db
import datetime
config = Config()
#config.SQLALCHEMY_DATABASE_URI = 'sqlite:///GranConcepcion-{}.db'.format(datetime.datetime.now().strftime("%Y%m%d%H%M"))
config.SQLALCHEMY_DATABASE_URI = 'sqlite:///GranConcepcion-process.db'
config.DEBUG = True
iapp = create_app(config)
with iapp.app_context():
from webinterface.models.cargamodelo import load_dataset, completa_dataset, agrega_paraderos
# db.create_all()
# load_dataset()
completa_dataset()
agrega_paraderos()

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More