config can be changed on the fly, moved to volume
This commit is contained in:
parent
a3ddc41118
commit
f671a3b198
@ -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"]
|
||||
|
@ -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`
|
||||
|
||||
|
@ -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:
|
||||
|
Reference in New Issue
Block a user