[DEV] add config

This commit is contained in:
Edouard DUPIN 2020-03-09 22:26:30 +01:00
parent 0cc5d1baf6
commit e8ebc1a558
3 changed files with 25 additions and 2 deletions

2
back/.gitignore vendored
View File

@ -1,4 +1,4 @@
config.*
#config.*
config.env
.env
config

View File

@ -6,7 +6,7 @@ RUN apk update && \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/community \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
build-base mediainfo
build-base mediainfo postgresql-dev gcc python3-dev musl-dev
RUN pip3 install --upgrade pip

23
back/src/config.py Executable file
View File

@ -0,0 +1,23 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author Edouard DUPIN
##
## @copyright 2012, Edouard DUPIN, all right reserved
##
## @license MPL v2.0 (see license file)
##
#pip install paho-mqtt --user
import os
def get_rest_config():
variable = {
"tmp_data": "tmp",
"data": "data",
"data_media": "data/media",
"host": os.getenv('REST_HOSTNAME', "0.0.0.0"),
"port": int(os.getenv('REST_PORT', 80)),
}
return variable