Files
TestPostsBot/Dockerfile
T

24 lines
523 B
Docker
Raw Normal View History

2026-03-04 23:01:36 +00:00
# Dockerfile for Reddit Test Posts Bot
FROM python:3.11-slim
2026-03-11 17:42:51 +00:00
# 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
2026-03-04 23:01:36 +00:00
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
2026-03-11 17:42:51 +00:00
2026-03-05 15:54:44 +00:00
COPY bot.py .
COPY config.py .
2026-03-11 17:42:51 +00:00
# Create DB directory with proper permissions
RUN mkdir -p /app/DB && chown -R botuser:botgroup /app
2026-03-11 17:26:02 +00:00
ENV PYTHONUNBUFFERED=1
2026-03-11 17:42:51 +00:00
# Switch to non-root user
USER botuser
2026-03-04 23:01:36 +00:00
CMD ["python", "bot.py"]