feat: docker

This commit is contained in:
katamaz committed 2026-10-02 21:13:32 +03:00
1 parent 86d660acba
commit f1a26d80a8
4 files changed
+47 -1

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
# secrets - never bake the bot token into the image
config.ini
# local junk
.venv
.git
.gitignore
__pycache__
*.pyc
readme/
.dockerignore
Dockerfile
docker-compose.yml
+22
View File
@@ -0,0 +1,22 @@
FROM ghcr.io/astral-sh/uv:python3.14-bookworm-slim
WORKDIR /app
# Force uv to use the system Python instead of downloading its own
ENV UV_PYTHON_DOWNLOADS=never \
UV_COMPILE_BYTECODE=1 \
UV_LINK_MODE=copy \
PYTHONUNBUFFERED=1
# Install locked dependencies first so code changes don't invalidate this layer
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-dev
# Then copy the application itself
COPY main.py formater.py image.py ./
COPY assets ./assets
# Put the venv on PATH so `python` resolves to the venv interpreter
ENV PATH="/app/.venv/bin:$PATH"
CMD ["python", "main.py"]
+11
View File
@@ -0,0 +1,11 @@
services:
bot:
build:
context: .
dockerfile: Dockerfile
container_name: confucius-quote-bot
environment:
- PYTHONUNBUFFERED=1
volumes:
- ./config.ini:/app/config.ini:ro
restart: unless-stopped
Generated
+1 -1
View File
@@ -135,7 +135,7 @@ wheels = [
]
[[package]]
name = "confucius-citate-bot"
name = "confucius-quote-bot"
version = "0.1.0"
source = { virtual = "." }
dependencies = [