add k8s support and upload image to ghcr.io

This commit is contained in:
2026-07-16 19:06:33 +03:00
parent 36a1cdee1d
commit 4020fedf9a
7 changed files with 293 additions and 7 deletions
+21 -6
View File
@@ -1,11 +1,26 @@
FROM python:3.12-slim
FROM python:3.12-slim-bookworm
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN groupadd --gid 1000 app \
&& useradd \
--uid 1000 \
--gid 1000 \
--no-create-home \
--shell /usr/sbin/nologin \
app
COPY bot.py .
COPY .env .
COPY requirements.txt ./
RUN pip install \
--no-cache-dir \
--disable-pip-version-check \
-r requirements.txt
CMD sh -c "export $(grep -v '^#' .env | xargs) && python bot.py"
COPY --chown=app:app bot.py ./
USER app:app
CMD ["python", "bot.py"]