-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (29 loc) · 1.01 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM python:3.11.2-slim
ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1
WORKDIR ~/TelegramBotDockerTmpl
COPY requirements.txt .
RUN pip install --no-cache-dir -r ./requirements.txt
COPY app ./app
CMD ["python", "-m", "app"]
# -------------------------------
# Build an image from a Dockerfile:
# $ docker build -t telegram_bot_docker_tmpl .
# -------------------------------
# Create and run a new container from an image:
# $ docker run -d --name TelegramBotDockerTmpl --env "BOT_TOKEN=<BOT_TOKEN>" telegram_bot_docker_tmpl
# -------------------------------
# Stop running container:
# $ docker stop TelegramBotDockerTmpl
# -------------------------------
# Start stopped container:
# $ docker start TelegramBotDockerTmpl
# -------------------------------
# Remove container:
# $ docker rm TelegramBotDockerTmpl
# -------------------------------
# Remove image:
# $ docker rmi telegram_bot_docker_tmpl
# -------------------------------
# Execute a command in a running container:
# $ docker exec -it TelegramBotDockerTmpl bash