#Error when running using docker-compose

1 messages · Page 1 of 1 (latest)

broken trout
#

So I'm trying to host my friend's bot in my VPS and I'm using docker-compose to containerise his bot. His bot works if i run it on my host (i'm using linux, specifically fedora 36), so I tried to make it into a docker container with this code:

docker-compose.yml:

services:
  susbot:
    build:
      context: .
      dockerfile: Dockerfile
      target: build
    container_name: susbot
    command: python ./susbot.py

Dockerfile:

FROM python:3 as build
COPY . /app
WORKDIR /app
FROM gcr.io/distroless/python
COPY --from=build-env /app /app
WORKDIR /app
CMD ["python", "./susbot.py"]

requirements.txt:

disnake==2.7.0

But when I try to run it by doing docker-compose up, It gives me the error in the image i've attached to this post

I assume it has to do with the python version I've set up to the docker image. Again, it works if i run it on my host machine by doing python susbot.py. idk anything about python lol I'm a c++ dev

modest swiftBOT
#
Too Many Tags

Please use either the disnake or python tag, but not both. If your question pertains to disnake, please use the disnake tag. If your question is a general python question that does not depend on disnake, please use the python tag.
I've taken a guess based on the contents of your message which your question is actually about.

If you believe this to be in error, please let us know.

azure quail
#

That's an error with python 3.11 that was fixed in disnake v2.7, the traceback looks like an older version

broken trout
#

how would i fix it

azure quail
#

something like this should work, making sure the correct versions are installed in the container

FROM python:3.11
COPY . /app
WORKDIR /app
RUN pip install -r requirements.txt
CMD ["python", "./susbot.py"]
broken trout
azure quail
#

hmm

#

there's no install step in the dockerfile you posted, where did the package even come from? I'm a bit confused

broken trout
#

OH

#

FUCK

#

nvm it still doesn't work @azure quail