We are using the reverse proxy traefik.
- Follow these instructions on how to setup Traefik (First two steps)
- Navigate to your directory of TheSpaghettiDetective
cd TheSpaghettiDetective - Edit the docker-compose.yml file with your favorite editor:
nano docker-compose.yml -
- Add
labels:andnetworks:to theweb:section - and also add
networks:at the end of the file
... web: <<: *web-defaults hostname: web ports: - 3334:3334 labels: - traefik.backend=thespaghettidetective - traefik.frontend.rule=Host:spaghetti.your.domain - traefik.docker.network=web - traefik.port=3334 networks: - web depends_on: - ml_api command: sh -c "python manage.py collectstatic --noinput && python manage.py migrate && python manage.py runserver 0.0.0.0:3334" ... ... networks: web: external: true - Add
- Start TheSpaghettiDetective with
docker-compose up -d - You should now be able to browse to
spaghetti.your.domain
- Create a bot. You can do this by messaging @BotFather - see telegram's documentation for further information.
- Add TELEGRAM_BOT_TOKEN to docker-compose.yml with the token @BotFather generated.
- Set the bot's domain by messaging @BotFather
/setdomain, selecting your bot, and sending him your bot's domain name. This must be a publicly-accessible domain name. You can temporarily generate a publicly-accessible domain name through a local tunnel - see [https://localtunnel.github.io/www/] or [https://serveo.net/#manual] for two good options. - Log in to telegram from your user preferences page (let's say your publicly accessible domain name is
https://tunnel.serveo.net/. You'd go tohttps://tunnel.serveo.net, log into your local TheSpaghettiDetective account -- by defaultroot@example.com-- and go to the user preferences page, then log into telegram and hit the form'ssavebutton). - That's it! Once you've logged in once, you will no longer need a publicly-accessible domain name.