diff --git a/Dockerfile b/Dockerfile index 9898e9d..d5e618e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,4 +15,4 @@ RUN pip install . gobject PyGObject "matrix-nio@git+https://github.com/poljar/ma VOLUME /data ENTRYPOINT ["pantalaimon"] -CMD ["-c", "/data/pantalaimon.conf"] +CMD ["-c", "/data/pantalaimon.conf", "--data-path", "/data"] diff --git a/pantalaimon/main.py b/pantalaimon/main.py index a30a708..8917d8d 100644 --- a/pantalaimon/main.py +++ b/pantalaimon/main.py @@ -128,8 +128,9 @@ async def message_router(receive_queue, send_queue, proxies): default=None, ) @click.option("-c", "--config", type=click.Path(exists=True)) +@click.option("--data-path", type=click.Path(exists=True)) @click.pass_context -def main(context, log_level, config): +def main(context, log_level, config, data_path): loop = asyncio.get_event_loop() conf_dir = user_config_dir("pantalaimon", "") @@ -137,6 +138,7 @@ def main(context, log_level, config): create_dirs(data_dir, conf_dir) config = config or os.path.join(conf_dir, "pantalaimon.conf") + data_dir = data_path or data_dir if log_level: log_level = parse_log_level(log_level)