File size: 586 Bytes
d55d6b9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Use the official Python 3.9 image as the base
FROM python:3.9

# Create a new user to avoid running as root
RUN useradd -m -u 1000 user
USER user

# Add local binary path to the environment PATH
ENV PATH="/home/user/.local/bin:$PATH"

# Set the working directory in the container
WORKDIR /app

# Copy and install Python dependencies
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt

# Copy the bot code into the container
COPY --chown=user . /app

# Specify the default command to run the bot
CMD ["python", "bot.py"]