This commit is contained in:
2026-03-11 18:25:51 +00:00
parent 0e01f803b2
commit b9ddeb5303
3 changed files with 2 additions and 27 deletions
+2 -14
View File
@@ -2,27 +2,15 @@
FROM python:3.11-slim
# Create a non-root user for running the bot
RUN groupadd -g ${GROUP_ID:-1000} botgroup && \
useradd -u ${USER_ID:-1000} -g botgroup -m botuser
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY bot.py .
COPY config.py .
COPY entrypoint.sh .
# Make entrypoint.sh executable
RUN chmod +x /app/entrypoint.sh
# Create DB directory with proper permissions
RUN mkdir -p /app/DB && chown -R botuser:botgroup /app
# Create DB directory
RUN mkdir -p /app/DB
ENV PYTHONUNBUFFERED=1
# Switch to non-root user
USER botuser
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["python", "bot.py"]