add k8s support and upload image to ghcr.io
This commit is contained in:
+21
-6
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user