a few docker-related fixes

This commit is contained in:
2024-07-26 19:11:26 +02:00
parent 2736a89f70
commit 3fa689fd16
6 changed files with 34 additions and 33 deletions

View File

@@ -14,4 +14,4 @@ EXPOSE 8000
ENV NUM_WORKERS=1
ENV OSM_CACHE_DIR=/cache
CMD ["fastapi", "run", "src/main.py", "--port 8000", "--workers $NUM_WORKERS"]
CMD fastapi run src/main.py --port 8000 --workers $NUM_WORKERS

View File

@@ -2,7 +2,8 @@ import logging.config
from pathlib import Path
import os
PARAMETERS_DIR = Path('src/parameters')
LOCATION_PREFIX = Path('src')
PARAMETERS_DIR = LOCATION_PREFIX / 'parameters'
AMENITY_SELECTORS_PATH = PARAMETERS_DIR / 'amenity_selectors.yaml'
LANDMARK_PARAMETERS_PATH = PARAMETERS_DIR / 'landmark_parameters.yaml'
OPTIMIZER_PARAMETERS_PATH = PARAMETERS_DIR / 'optimizer_parameters.yaml'
@@ -16,7 +17,7 @@ OSM_CACHE_DIR = Path(cache_dir_string)
import logging
import yaml
LOGGING_CONFIG = Path('log_config.yaml')
LOGGING_CONFIG = LOCATION_PREFIX / 'log_config.yaml'
config = yaml.safe_load(LOGGING_CONFIG.read_text())
logging.config.dictConfig(config)