title: Python Discord Bot in Docker
body: <p>I'm fairly new to Docker and am trying to have a python Discord bot in a container.</p>
  <p>My project folder structure is the following:</p>
  <pre><code>- util
  - - logger.py
  - cogs
  - - part-of-the-bot.py
  - requirements.txt
  - run.py
  </code></pre>
  <p>I've checked some tutorials and the <a href="https://hub.docker.com/_/python" rel="nofollow noreferrer">official python docker hub page</a> to help me create the <code>Dockerfile</code>:</p>
  <pre><code>FROM python:3.9
  
  WORKDIR /usr/src/app
  
  COPY requirements.txt ./
  RUN pip install --no-cache-dir -r requirements.txt
  
  COPY . .
  RUN chmod +x run.py
   
  CMD [ &quot;python&quot;, &quot;run.py&quot; ]
  </code></pre>
  <p>After that, I use <code>docker build -t bot .</code> and docker-compose with the following YAML file:</p>
  <pre class="lang-yaml prettyprint-override"><code>version: '3'
  
  services: 
    discord-bot:
       image: bot:latest
       restart: unless-stopped
       volumes:
         - ~/volumes/bot:/usr/src/app
  
  </code></pre>
  <p>However, there are some issues with it:
  Currently I get an error about the file <code>/usr/src/app/run.py</code> not existing:</p>
  <pre><code>python: can't open file '/usr/src/app/run.py': [Errno 2] No such file or directory
  python: can't open file '/usr/src/app/run.py': [Errno 2] No such file or directory
  python: can't open file '/usr/src/app/run.py': [Errno 2] No such file or directory
  python: can't open file '/usr/src/app/run.py': [Errno 2] No such file or directory
  python: can't open file '/usr/src/app/run.py': [Errno 2] No such file or directory
  python: can't open file '/usr/src/app/run.py': [Errno 2] No such file or directory
  python: can't open file '/usr/src/app/run.py': [Errno 2] No such file or directory
  python: can't open file '/usr/src/app/run.py': [Errno 2] No such file or directory
  python: can't open file '/usr/src/app/run.py': [Errno 2] No such file or directory
  python: can't open file '/usr/src/app/run.py': [Errno 2] No such file or directory
  python: can't open file '/usr/src/app/run.py': [Errno 2] No such file or directory
  python: can't open file '/usr/src/app/run.py': [Errno 2] No such file or directory
  python: can't open file '/usr/src/app/run.py': [Errno 2] No such file or directory
  python: can't open file '/usr/src/app/run.py': [Errno 2] No such file or directory
  </code></pre>
  <p>I have checked this with some <code>RUN pwd</code> and <code>RUN ls</code> in the Dockerfile and everything seems to have been copied correctly.</p>
  <p>I'm also having trouble figuring out if I need to open a port for the Discord bot to work.</p>
  <p>EDIT: I had tried the <code>discord.py</code> image on docker hub but it seems it is not suited for the Raspberry Pi architecture.</p>