diff --git a/Dockerfile b/Dockerfile index 2f3419a..e0e7b29 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,5 +3,4 @@ WORKDIR /usr/src/app COPY requirements.txt ./ RUN pip install --no-cache-dir -r requirements.txt COPY src . -COPY config.json ./ CMD [ "python", "bot.py"] diff --git a/README.md b/README.md index 506e16b..5e86a47 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ A bot to hold your todo.txt tasks ### install 1. `git clone` the project or download it 2. Create bot with [@botfather](https://t.me/botfather) -3. create `config.json` in root directory of project: +3. create `YOUR_CONFIG_DIRECTORY/config.json`: ```json { "token": "285908433:AAHyxGFXtG37Ox_AvPPYB_J73iNpT7rk1JM" @@ -14,8 +14,8 @@ A bot to hold your todo.txt tasks } ``` 4. run `cp docker-compose.example docker-compose.yml` -5. run `mkdir YOUR_TASKS_DIRECTORY` -6. run `echo {} > YOUR_TASKS_DIRECTORY/tasks.json` +5. run `mkdir YOUR_CONFIG_DIRECTORY` +6. run `echo {} > YOUR_CONFIG_DIRECTORY/tasks.json` 7. edit `docker-compose.yml` bot.volumes to match your directory with your tasks 8. run `docker-compose up` diff --git a/src/bot.py b/src/bot.py index a4c4107..e6ffb0b 100755 --- a/src/bot.py +++ b/src/bot.py @@ -20,9 +20,9 @@ VERSION = "v1.1" PROPERTY_LAST_COMMAND = "last_command" PROPERTY_LAST_ARGUMENTS = "last_arguments" -CONFIG_FILE = 'config.json' +CONFIG_FILE = '/config/config.json' ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' -TASKS_FILE="/tasks/tasks.json" +TASKS_FILE="/config/tasks.json" with open(CONFIG_FILE) as file: