Skip to content

Instantly share code, notes, and snippets.

@justingood
Last active April 13, 2019 10:01
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justingood/020e24222fa1653f5cd0 to your computer and use it in GitHub Desktop.
Save justingood/020e24222fa1653f5cd0 to your computer and use it in GitHub Desktop.
An example to set up a Telegram bot in Docker
tg:
image: justingood/tg
ports:
- "4458:4458"
#Expose the telegram-cli as a volume
volumes:
- .telegram-cli:/root/.telegram-cli
bot:
#Build using local Dockerfile
build: .
#Link to the tg container
links:
- tg
#Mount the local dev directory into the /app dir in the container so we can test while we develop.
volumes:
- .:/app
FROM python:3.5
WORKDIR /app
COPY requirements.txt /app/
RUN pip install -r requirements.txt
COPY . /app/
CMD python bot.py
@luckydonald
Copy link

Should that run as root? On normal environments you try to avoid that for server like instances. Is that save in docker?

@luckydonald
Copy link

It is not safe even in docker!

@naarkhoo
Copy link

naarkhoo commented Jan 1, 2019

@luckydonald why not ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment