From 64d9b304a9e0326a55412b0ce0e6455549945363 Mon Sep 17 00:00:00 2001 From: Rene Arumetsa Date: Mon, 20 Apr 2026 22:37:55 +0300 Subject: [PATCH] Add container support --- .dockerignore | 14 ++++++++++++++ Dockerfile | 15 +++++++++++++++ compose.yaml | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 compose.yaml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5b1c2e0 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,14 @@ +.git +.gitignore +.env +.env.* +*.pyc +__pycache__ +data/ +logs/ +*.log +*.md +.dockerignore +Dockerfile +compose.yaml +credentials.json diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f398d59 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM python:3.13-slim + +WORKDIR /app + +# Install dependencies +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +# Copy application code +COPY . . + +# Create data and logs directories +RUN mkdir -p data logs + +CMD ["python", "bot.py"] diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..1869b5d --- /dev/null +++ b/compose.yaml @@ -0,0 +1,33 @@ +services: + pocketbase: + image: ghcr.io/muchobien/pocketbase:latest + container_name: tipibot-pocketbase + restart: unless-stopped + volumes: + - pb_data:/pb_data + ports: + - "8090:8090" + healthcheck: + test: ["CMD", "wget", "-q", "--spider", "http://localhost:8090/api/health"] + interval: 10s + timeout: 5s + retries: 3 + + bot: + build: . + container_name: tipibot + restart: unless-stopped + depends_on: + pocketbase: + condition: service_healthy + env_file: + - .env + environment: + - PB_URL=http://pocketbase:8090 + volumes: + - ./data:/app/data + - ./logs:/app/logs + - ./credentials.json:/app/credentials.json:ro + +volumes: + pb_data: