Answer the question
In order to leave comments, you need to log in
How to correctly specify the path to the folder, for use in docker?
when running the image, docker throws an error
File "/usr/src/app/./index.py", line 26, in handle_text
photo = open('test/' + random.choice(os.listdir('test')), 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'test'
FROM python:3-alpine
WORKDIR /usr/src/app
LABEL version="1.0"
COPY /* ./
RUN pip install -r requirements.txt
CMD [ "python", "./index.py" ]
if message.text.lower() == 'получить вопрос':
photo = open('test/' + random.choice(os.listdir('test')), 'rb')
Answer the question
In order to leave comments, you need to log in
it was necessary to specify in docerfile
COPY ./ ./
instead of
COPY /* ./
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question