Stable version 1.0
This commit is contained in:
31
dockerfile
Normal file
31
dockerfile
Normal file
@@ -0,0 +1,31 @@
|
||||
# Use official Python image
|
||||
FROM python:3.11-slim
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
gcc \
|
||||
python3-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy requirements first to leverage Docker cache
|
||||
COPY requirements.txt .
|
||||
|
||||
# Install Python dependencies
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy the rest of the application
|
||||
COPY . .
|
||||
|
||||
# Create a non-root user and switch to it
|
||||
RUN useradd -m botuser && chown -R botuser:botuser /app
|
||||
USER botuser
|
||||
|
||||
# Set environment variables for configuration
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV CONFIG_PATH=/app/config.ini
|
||||
|
||||
# Command to run the bot
|
||||
CMD ["python", "pterodisbot.py"]
|
Reference in New Issue
Block a user