xtrime-ru / TelegramApiServer

Fast, simple, async php telegram api server: MadelineProto + Amp HTTP Server
https://tg.i-c-a.su
MIT License
529 stars 116 forks source link

Use without database #134

Closed foremtehan closed 11 months ago

foremtehan commented 11 months ago

Is it possible to use the server without databases? I set the DB_TYPE=memory and remove mysql in docker-compose file, But when i run the api container it says Host [mysql:3306] not yet available

xtrime-ru commented 11 months ago

You must create docker-compose.override.yml and override WAIT_HOSTS env varibale:

    api: 
        environment:
           WAIT_HOSTS: mysql:3306

Please reffer to corresponging docs:

https://github.com/ufoscout/docker-compose-wait https://docs.docker.com/compose/extends/

Difficult part, that docker overrides array by merging values. So if you create empty WAIT_HOSTS in docker-compose.override.yml you will get two WAIT_HOSTS entries in result. I dont know how docker compose will handle this. You need try.

Also you can just remove WAIT_HOSTS from docker-compose.yml, but i do not recommend to edit files in git, it will prevent git to update project in future.