tejado / telegram-nearby-map

Discover the location of nearby Telegram users 📡🌍
GNU General Public License v3.0
1.04k stars 149 forks source link

Docker build added #38

Open takov751 opened 2 years ago

takov751 commented 2 years ago

Greetings,

I created a simple docker version, which was double staged for anyone whom using their own registry or want to move docker image after build. API_ID and API_HASH loaded from env so that it can be called easily. There is a room for improvement, however is does the job. Of course because of the native lib dependencies (which could be integrated later to make it cross-platform) it's only works on x86_64

takov751 commented 2 years ago

Config.json file missing from this pull request due to user error . I will do that when I get back to the keyboard.

tejado commented 2 years ago

Awesome - thank you. How to provide the confirmation code in that way? And it is important to know and to describe, that the confirmation code is asked every time as the database is not cached if there is no persistent volume for it.

takov751 commented 2 years ago

I wrote a small md which mentions if you start running it with docker run it's attaches the cli in your terminal so it's rather convenient for now. If someone wraps it inside a tmux / screen session or run it from portainer or yacht it can be more user friendly to attach detach the docker cli session I realise it now I should have write it inside readme. If I don't forget I will merge the run.md and readme.md in this PR

tejado commented 2 years ago

I will wait for your additions :) Can ping you here in few days if you forgot about it.

takov751 commented 2 years ago

Well, I have moved files to root of the repo to make it easier for anyone. Hope you find it useful. Oh and I included somewhat a solution that user will have presistent session after a cold run to setup session.

takov751 commented 2 years ago

One more thing when i tried to rebase image to from node:17-bullseyes-slim to node:18-buster-slim on startup Parcel failed to build The site

tylerhindi1 commented 2 years ago

One more thing when i tried to rebase image to from node:17-bullseyes-slim to node:18-buster-slim on startup Parcel failed to build The site

hey i run docker file command and i get error Screenshot 2022-06-12 133640

takov751 commented 2 years ago

One more thing when i tried to rebase image to from node:17-bullseyes-slim to node:18-buster-slim on startup Parcel failed to build The site

hey

i run docker file command and i get error

Screenshot 2022-06-12 133640

So first i would say one problem is that you are trying to add your public ip as HOST which is not going to work in your setup so it's hard to tell what command you were running just with this information instead of your public ip I would recommend just use 0.0.0.0 and I wouldn't recommend making it available publicly on the internet especially not on port 80. I would recommend using tunnelling over ssh, vpn or just a reverse proxy https connection with basic http auth .

To summarise to help you we would need more information what you were trying to run first just leave host and port with default settings. And if you more comfortable with how docker works, then try to modify it to your need.

tejado commented 2 years ago

One more thing when i tried to rebase image to from node:17-bullseyes-slim to node:18-buster-slim on startup Parcel failed to build The site

do you have an error message on that?

tejado commented 2 years ago

Well, I have moved files to root of the repo to make it easier for anyone. Hope you find it useful. Oh and I included somewhat a solution that user will have presistent session after a cold run to setup session.

Now, files are duplicated :) And maybe instead of modifying / providing a separate docker config file, you can adjust the server.js, to check if there are env vars set. If not, then a config.js has to be there.

takov751 commented 2 years ago

Well, I have moved files to root of the repo to make it easier for anyone. Hope you find it useful. Oh and I included somewhat a solution that user will have presistent session after a cold run to setup session.

Now, files are duplicated :) And maybe instead of modifying / providing a separate docker config file, you can adjust the server.js, to check if there are env vars set. If not, then a config.js has to be there.

Fair enough . I was thinking more like just keeping config.js with const = env || default . Would that be more user friendly ?

takov751 commented 2 years ago

So I made some changes, which can cause problem for non-docker users. Which I just realised now. Thanks for the quick feedback and communication :smile: