Commit d0e48807 authored by Konstantin Schulz's avatar Konstantin Schulz

fixed host IP problems for the docker compose service 'mcserver'

parent 402ffe3c
Pipeline #11597 failed with stages
in 23 minutes and 6 seconds
......@@ -16,8 +16,6 @@ DATABASE_URL_PROD=postgresql://postgres@db:5432/
DATABASE_URL=postgresql://postgres@db:5432/
# Change this to "production" for public use
FLASK_ENV_VARIABLE=development
# for Windows, use 127.0.0.1 instead
HOST_IP=0.0.0.0
RUST_BACKTRACE=1
OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
```
......
......@@ -88,10 +88,10 @@ def init_app_common(cfg: Type[Config] = Config, is_csm: bool = False) -> Flask:
app.app_context().push()
db.init_app(app)
migrate.init_app(app, db)
db.create_all()
if is_csm:
from mcserver.app.services.databaseService import DatabaseService
DatabaseService.init_db_alembic()
db.create_all()
from mcserver.app.services.textService import TextService
TextService.init_proper_nouns_list()
TextService.init_stop_words_latin()
......
......@@ -11,7 +11,7 @@ from mcserver.app.models import CitationLevel, ResourceType, TextComplexityMeasu
AnnisResponse, GraphData, TextComplexity
from mcserver.app.services import CorpusService, CustomCorpusService, TextComplexityService
from mcserver.config import Config
from mcserver.models_auto import Corpus, Exercise, TExercise, UpdateInfo
from mcserver.models_auto import Corpus, Exercise, UpdateInfo
class DatabaseService:
......
......@@ -81,8 +81,10 @@ class Config(object):
H5P_FILL_BLANKS = "fill_blanks"
H5P_MULTI_CHOICE = "multi_choice"
H5P_VOC_LIST = "voc_list"
HOST_IP_MCSERVER = os.environ.get("HOST_IP", DOCKER_SERVICE_NAME_MCSERVER if IS_DOCKER else "127.0.0.1")
HOST_IP_CSM = DOCKER_SERVICE_NAME_CSM if IS_DOCKER else HOST_IP_MCSERVER
# Windows: use 127.0.0.1 as host IP fallback
HOST_IP_FALLBACK = "0.0.0.0"
HOST_IP_CSM = DOCKER_SERVICE_NAME_CSM if IS_DOCKER else HOST_IP_FALLBACK
HOST_IP_MCSERVER = DOCKER_SERVICE_NAME_MCSERVER if IS_DOCKER else HOST_IP_FALLBACK
HOST_PORT = 5000
INTERNET_PROTOCOL = "http://"
INTERVAL_CORPUS_AGE_CHECK = 60 * 60
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment