From 5a0548d6e2ad1f8da4f00da0402272fb2efda005 Mon Sep 17 00:00:00 2001 From: Gylfirst Date: Tue, 16 Jan 2024 17:17:08 +0100 Subject: [PATCH] add the docker files to containerized the bot --- .dockerignore | 6 ++++++ Dockerfile | 15 +++++++++++++++ docker-compose.yaml.example | 8 ++++++++ 3 files changed, 29 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yaml.example diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..8975894 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +.github +.env +.env.example +.gitignore +LICENSE +README.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..72e14af --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +# Dockerfile for the python discord bot + +FROM python:3.12-alpine # test with 3.11-alpine if gcc needed or not + +RUN apk --no-cache add gcc musl-dev + +WORKDIR /usr/src/chouettebot + +COPY requirements.txt ./ +RUN pip install --upgrade pip +RUN pip install -r requirements.txt + +COPY . . + +CMD ["python3","main.py"] diff --git a/docker-compose.yaml.example b/docker-compose.yaml.example new file mode 100644 index 0000000..948a8d7 --- /dev/null +++ b/docker-compose.yaml.example @@ -0,0 +1,8 @@ +version: "3.8" + +services: + bot: + image: chouettebot # Name of the image you built + container_name: "chouette-bot" # Name of the container you want to display + volumes: + - /path/to/env/.env:/usr/src/chouettebot/.env # Path to .env file