diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..0f6c6f71 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +.git +.gitignore +__pycache__ +*.pyc +*.pyo +*.pyd +*.log +.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..3d32b1d6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM python:3.11-slim + +WORKDIR /app + +# install git (sometimes needed for dependencies) +RUN apt-get update && apt-get install -y git + +# copy project files +COPY . . + +# install dependencies +RUN pip install --no-cache-dir -r requirements.txt + +# run the bot +CMD ["sh", "-c", "alembic upgrade heads && python -m cloudbot"] \ No newline at end of file diff --git a/README.md b/README.md index 08e39d28..a1fc96c3 100644 --- a/README.md +++ b/README.md @@ -85,3 +85,17 @@ This product uses data from http://wordnik.com [latest source]: https://github.com/TotallyNotRobots/CloudBot/archive/main.zip [latest release]: https://github.com/TotallyNotRobots/CloudBot/releases/latest [TheTVDB.com]: https://thetvdb.com/ + +## Running with Docker + +Build the image: + +docker build -t cloudbot . + +Run the bot: + +docker run cloudbot + +Or use docker compose: + +docker compose up \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..d112719b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +services: + cloudbot: + build: . + container_name: cloudbot + restart: unless-stopped + volumes: + - ./config.json:/app/config.json \ No newline at end of file