• 카테고리

    질문 & 답변
  • 세부 분야

    풀스택

  • 해결 여부

    해결됨

61강 진행중에 에러가 납니다.

21.05.13 13:29 작성 조회수 463

1

61강 후반부에 도커파일을 가지고 이미지를 만드려는데 아래와 같은 에러가 나네요

EOFError

EOF when reading a line

The command '/bin/sh -c python manage.py collectstatic' returned a non-zero code: 1

특별히 collectstatic 부분은 수정한 게 없는데 원인이 뭔지 알 수 있을까요? 아래는 도커 파일 코드입니다.

FROM python:3.9.0

WORKDIR /home/

RUN echo "testing"

RUN git clone https://github.com/Webdornald/SynapseComponent.git

WORKDIR /home/SynapseComponent/

RUN pip install -r requirements.txt

RUN pip install gunicorn

RUN pip install mysqlclient

RUN echo "숨김" > .env

RUN python manage.py collectstatic

EXPOSE 8000

CMD ["bash", "-c", "python manage.py migrate --settings=config.settings.deploy && gunicorn config.wsgi --env DJANGO_SETTINGS_MODULE=config.settings.deploy --bind 0.0.0.0:8000"]

답변 1

답변을 작성해보세요.

0

문제는 해결했습니다. 제가 오류내용을 너무 짧게 올려놨네요 ㅜㅜ 위에 한 줄이 더 있었습니다. collectstatic 에러 전부는 아래와 같습니다. 구글링을 해서 RUN python manage.py collectstatic --noinput 으로 명령어를 바뀌니까 성공했는데 이래도 문제가 없을까요?

Step 10/12 : RUN python manage.py collectstatic

 ---> Running in 65fa9291ebdb

You have requested to collect static files at the destination

location as specified in your settings:

    /home/SynapseComponent/_static

This will overwrite existing files!

Are you sure you want to do this?

Type 'yes' to continue, or 'no' to cancel: 

Traceback (most recent call last):

  File "/home/SynapseComponent/manage.py", line 22, in <module>

    

main()

  File "/home/SynapseComponent/manage.py", line 18, in main

    

execute_from_command_line(sys.argv)

  File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line

    

utility.execute()

  File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute

    

self.fetch_command(subcommand).run_from_argv(self.argv)

  File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv

    

self.execute(*args, **cmd_options)

  File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute

    

output = self.handle(*args, **options)

  File "/usr/local/lib/python3.9/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 184, in handle

    

if input(''.join(message)) != 'yes':

EOFError

EOF when reading a line

The command '/bin/sh -c python manage.py collectstatic' returned a non-zero code: 1

네 괜찮습니다.

--noinput 으로 진행을 하셔도 전혀 무방합니다.
아니 되려 이후 강의에서는 해당 옵션을 넣어주는 과정이 있습니다.

일단 61강 내용까지는 옵션을 굳이 넣지 않아도 구동이 되어 언급을 안했었는데,
해당 옵션이 없어서 진행이 되지 않았던게 맞나보네요.

아무튼 해결하셨다니 다행이네요!

채널톡 아이콘