diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..2120f16f52cc742880c3d605202fb8f667f834b9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM monetdb/monetdb:latest + +# Nome do banco para criar +ENV MDB_CREATE_DBS=treinamento + +# Senha do user monetdb +ENV MDB_DB_ADMIN_PASS=12345 + +RUN mkdir open_data + +COPY ./open_data/ ./open_data + +EXPOSE 50000 diff --git a/settings.py b/settings.py index 75a4f5b991cc7341dd29a10985508dae691bcc48..bb1888c9c38014f49a7421152a039092714fb105 100644 --- a/settings.py +++ b/settings.py @@ -22,7 +22,7 @@ along with HOTMapper. If not, see <https://www.gnu.org/licenses/>. import logging def db_env_file_path(file_name): - return file_name.replace('glc22', 'monetdb') + return "/open_data/"+file_name.split('/')[-1] # SQL dialect used by sqlalchemy. DATABASE_DIALECT = 'monetdb' @@ -34,6 +34,7 @@ DATABASE_USER_PASSWORD = '12345' # Host to connect to. Bulk inserts won't work remotely unless you can specify an # absolute path in the server DATABASE_HOST = 'localhost' +DATABASE_PORT = '50001' # Database to connect to DATABASE = 'treinamento' @@ -42,8 +43,9 @@ DATABASE = 'treinamento' YEAR_COLUMN = 'ano_censo' # URI structure. Standards to login:password model, but can be changed as needed. -DATABASE_URI = '{}://{}:{}@{}/{}'.format(DATABASE_DIALECT, DATABASE_USER, - DATABASE_USER_PASSWORD, DATABASE_HOST, DATABASE) +DATABASE_URI = '{}://{}:{}@{}:{}/{}'.format(DATABASE_DIALECT, DATABASE_USER, + DATABASE_USER_PASSWORD, DATABASE_HOST, + DATABASE_PORT, DATABASE) # Folder and file where backup is created - absolute path BACKUP_FOLDER = '/home/banco/dumps/monetdb/' BACKUP_FILE = 'backupdadoseducacionais'